I just want to create a dropdown list whenever I choose a new value inside it will take me to a new webpage. I don't want to let user to click "GO" button to go to the page. Just on select and call the action. How can I do such ?
<form>
<p align="center"><b>Select a Site </b>
<select id="setit" style="color: #0000FF" size="1" name="test">
<option value="">Select one</option>
<option value="http://www.altavista.com">AltaVista</option>
<option value="http://www.yahoo.com">Yahoo</option>
<option value="http://www.google.com">Google</option></select>
<input type="button" value="Go"
onclick="window.open(setit.options[setit.selectedIndex].value)">
</p></form>
Here for example, this will have the GO button and need to click the GO in order to go to the new page. I don't want the GO button.
Any ideas?
use onchange event:
<select onchange="window.open(this.value,'','');">
....
</select>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With