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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto redirect form a drop down box

Status
Not open for further replies.

krappleby025

Programmer
Sep 6, 2001
347
NL
I have seen many people asking about how to redirect using a drop down box, so that you do not have to submit, you change the value and you are sent to the next page...

well here is a piece of coding that does that, on your select choice, use the following

<FORM action=&quot;page.asp&quot; method=&quot;get or post&quot; >
<SELECT name=&quot;maingroup&quot; onchange=&quot;submit(this.options[this.selectedIndex].value)&quot;>
<OPTION selected value=&quot;test1&quot;>test1</OPTION>
<OPTION value=&quot;test2&quot;>test2</OPTION>
</select></FORM>

The above will automatically submit the form as soon as the drop meny is changed, It acts like a normal submit so it will be sent to the form action url

hope that helps you beginners, especially, it took me ages to find that

thanks

keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top