Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Apr 2011
    Posts
    27
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Pass parameter to html link in submit button

    I want to pass a parameter to a html link in the submit button like this:

    Code:
    <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!

  • #2
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Use a hidden input.

  • #3
    New Coder
    Join Date
    Apr 2011
    Posts
    27
    Thanks
    1
    Thanked 0 Times in 0 Posts
    how? i want a button that links to the link.. a hidden input cant be seen so how will it help?

  • #4
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Quote Originally Posted by cyborg911 View Post
    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.

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •