PDA

View Full Version : Pass parameter to html link in submit button



cyborg911
Feb 27th, 2012, 03:22 PM
I want to pass a parameter to a html link in the submit button like this:


<form action="question.jsp?quesno=1">
<input type="submit" value="C Exam"></input>
</form>

where quesno is the parameter to be passed.. however when i click on the submit button it only goes to http://localhost:8084/Abhishek/question.jsp?
instead of going to http://localhost:8084/Abhishek/question.jsp?quesno=1.
Please help!

Apostropartheid
Feb 28th, 2012, 12:10 AM
Use a hidden input.

cyborg911
Feb 28th, 2012, 07:18 AM
how? i want a button that links to the link.. a hidden input cant be seen so how will it help?

Apostropartheid
Feb 28th, 2012, 03:05 PM
how? i want a button that links to the link.. a hidden input cant be seen so how will it help?

Because it can't be seen.


<form action="question.jsp" method="get">
<fieldset>
<input type="submit" value="C Exam">
<input type="hidden" name="quesno" value="1">
</fieldset>
</form>