Pass document value via a link?

liunx

Guest
Hi,<br />
In following code i want to pass "usr" input box value to the "nxtpg.jsp" when "view" link clicks. But the "nxtpg.jsp"<br />
does not receive the value ( received empty string ). any thing i missed? <br />
<br />
<br />
<form name="frm"><br />
...<br />
<tr>User id :<input name="usr" size="2" /></tr> <br />
...<br />
<TR><br />
<td><A HREF=http://www.htmlforums.com/archive/index.php/"nxtpg.jsp?usr="+usr.value >View</A></td><br />
</TR> <br />
... <br />
</form><br />
<br />
<br />
I even tried:<br />
<td><A HREF=http://www.htmlforums.com/archive/index.php/"nxtpg.jsp?usr="+document.frm.usr.value >View</A></td><!--content-->because the link is not part of a form. the form has nothing to do with it. if you want the form variable to be sent to the jsp then you have to set an action to the form not in the link.<!--content-->any idea?<!--content-->I just told you<br />
if you want the form variable to be sent to the jsp then you have to set an action to the form<!--content-->Thanks for explanation. Any work around for this?<br />
I need to get a user define value on screen and send it via a link to another page as soon as that link clicked.<br />
Thanks in advance.<!--content-->:rolleyes: <br />
<br />
<form name="frm" action="nxtpg.jsp" method="get"><br />
...<br />
<tr><td>User id :<input name="usr" size="2" /></td></tr><br />
...<br />
<input type="submit" name="submit" value="submit"><br />
</form><!--content-->The problem is that you were not submitting the form information to the .jsp page. You were just linking to the .jsp page. The href can submit the form for you, if written to. <br />
<br />
<br />
<br />
<form name="frm" action="http://action.jsp" method="get"><br />
<br />
<tr>User id :<input name="usr" size="2" /></tr> <br />
<br />
<TR><br />
<td><A HREF=http://www.htmlforums.com/archive/index.php/"#" onClick="document.frm.submit()">View</A></td><br />
</TR> <br />
<br />
</form><!--content-->Thanks scoutt. <br />
I forced the user to click on a button after entering the value and this solved the problem. Thanks once again for your suggestion.<!--content-->
 
Back
Top