dynamic parameter passing within href

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arundhatirao
    New Member
    • Jan 2013
    • 1

    #1

    dynamic parameter passing within href

    i have a normal text field in 1.jsp and a hyperlink to 2.jsp.
    i need to send the value inserted in the text field from 1.jsp to 2.jsp through the href written in 1.jsp. plz guide me how.
  • Anas Mosaad
    New Member
    • Jan 2013
    • 185

    #2
    Wrap the text field in a form and make the form action 2.jsp and make the link submit that form.
    Last edited by Anas Mosaad; Jan 6 '13, 06:21 PM. Reason: remove typo error "the link "

    Comment

    • Anas Mosaad
      New Member
      • Jan 2013
      • 185

      #3
      Another solution would be that exactly implement your thoughts is:
      Code:
      var param = document.getElementById("txt");
      window.location.href = "URL" + "?txt=" + param;
      Although you have the option to choose any of the two options, I would recommend you to go for the previous one.

      Comment

      Working...