View Full Version : Sending Form field Via Href
Crash1hd
05-20-2003, 09:49 AM
Is it possible to submit a form field for example
<input name='user' value='you'>
in a link like so
<a href="/login.asp">Click here to login</a>
If so how?
I know how with a button I was just wondering if it had to be a button or if a link would work?
Spudhead
05-20-2003, 10:13 AM
<a href="javascript:document.myform.submit()">Click here to submit form</a>
Crash1hd
05-20-2003, 10:17 AM
So Would I have to use a form like <form><input name='user' value='you'></form>
or can I just have the <input name='user' value='you'>
and when you say myform is that the name of the form??
zoobie
05-20-2003, 10:52 AM
Yes...It's the form's name. Anytime you name a tag, you can then call on it or display it by name. :D
<form name="bob" action="mailto:me@yahoo.com" method="post">
<input type="text" name="Email">
</form>
<a href="javascript:this.bob.submit();">Submit</a>
Crash1hd
05-21-2003, 04:01 AM
can I make this work with onClick?
IE
<a href="page.asp" onClick="javascript:this.bob.submit();">Submit</a>
I am trying to make this work from an email?? any thoughts!
useing asp for the submitting to email?
zoobie
05-21-2003, 09:52 AM
Well, you'll get the same results using:
<a href="#" onClick="this.bob.submit();">Submit</a> onClick is a javascript event.
From an email? To an email? Lot's of members here will just skip over a problem like yours if you don't explain exactly what you're trying to do in full. Then, post your problematic code underneath. :D
Crash1hd
05-21-2003, 10:21 AM
Lol! I transfered this to the asp section as I figured it had to do with that more so!
http://www.codingforums.com/showthread.php?s=&threadid=20326
But I want to change the button to a link? which is why I was asking?
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.