Jump to content

html pass argument


houssam_ballout

Recommended Posts

Hello all,as for passing an argument in html page, I am using the following<a href="index.php?page=search_first.php&search=docum ent.search1.searchText.value" />I want to get the value from a text box to send it with the url so that I can use it in another page to search for it.but the upper one is not working?Do I make any mistake?Thanks in advance__________________

Link to comment
Share on other sites

If I'm not mistaken, your goal is to allow someone to type in a value into a text field and have that value be appended to the href of the link when the user clicks on that link?If that's the case, the simplist solution would be to add a onclick event handler to the link that appends the value of the text field to the href when someone clicks on the link:

<a href="index.php?page=search_first.php&search=" onclick="this.href += document.getElementById('search1').value">Click ME!</a>

Link to comment
Share on other sites

Hello all,as for passing an argument in html page, I am using the following<a href="index.php?page=search_first.php&search=docum ent.search1.searchText.value" />I want to get the value from a text box to send it with the url so that I can use it in another page to search for it.but the upper one is not working?Do I make any mistake?Thanks in advance__________________
The querystring will be set automatically if you place the textbox and other required fields in an html form. You could then use the link to execute some javascript which submits the form.
Link to comment
Share on other sites

It wouldn't work anyways, the href attribute doesn't run javascript.
Unless you use the java script: pseudo-protocol.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...