Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get a string value from typing and put in a address bar

Status
Not open for further replies.

xbl12

Programmer
Dec 12, 2006
66
Hi;

How to get a string value from typing and put in a address bar.
For example, if i type javascript tutorial, and then click submit, the url in the adress bar will like "
Could anyone can help me, please, thanks

<form action="index.php?" method="post">
search string: <input type="text" search="" />

<input type="submit" />
</form>
 
Just change the method of your form from POST to GET:

Code:
<form action="index.php?" method="[red]GET[/red]">
search string: <input type="text" search="" />

<input type="submit" />
</form>


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
it does not get the value into url and stay in the address bar
 
Thanks a lot, i have known how to do it now
 
can you post how you did it so that everybody can see and learn something, please?
thanks.
 
The original suggestion by Phil was correct - it's just that your form HTML was invalid, as this:

Code:
<input type="text" search="" />

should be:

Code:
<input type="text" name="search" />

Dan


Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Thanks, your one is easier.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top