Form Select Box To Goto New Page

[Total: 0    Average: 0/5]

This shows how to use a form select box to choose a new location to goto on the web.

Body Code:

<script type=text/javascript>
function doIt(_l) { document.location=_l; }
</script>
<form name=exf1>
<select name=sel1 size=1>
  <OPTION VALUE="http://www.js-examples.com/">JS-Examples Home Page
  <OPTION VALUE="http://www.js-examples.com/js/">JS-Examples Index
  <OPTION VALUE="http://www.js-examples.com/js/pic1.gif">Ball Gif
</select>
<input type=button value="Go!" onClick="doIt(this.form.sel1.options[this.form.sel1.selectedIndex].value)">
</form>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *