|
Q1319 How do I have a dropdown menu selection automatically load a page without hitting a submit button?
irt.org | Knowledge Base | JavaScript | Form | Q1319 [ previous next ]
Q1319 How do I have a dropdown menu selection automatically load a page without hitting a submit button?
Most of the information is in the article
Dropdown Menus
I personally prefer this:
<form>
<select name="theSelect" size=1 onChange="if (this.selectedIndex >0) window.location=this.options[this.selectedIndex].value">
<option value="">Please select a place to go
<option value="http://irt.org/">irt
<option value="http://www.microsoft.com/">MS
<option value="http://www.netscape.com/">NS
</select>
</form>
|
If you are going to handle 16 bit browsers you might want to add this:
<input type="button" value="go" onClick="if (this.for.theSelect.selectedIndex >0) window.location=this.form.theSelect.options[this.form.theSelect.selectedIndex].value">
|
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.