Drop Down Box with automatic redirect
We can do drop down box with automatic redirect using Java script. The following Java script code will enable visitors to click on a drop down box to select the location on web site in which they would like to navigate. Once they make their selection, they will automatically be taken to the location.
We can place this code where we would like the box to appear:
<Script language=”JavaScript”>
function goto(form) { var index=form.select.selectedIndex
if (form.select.options[index].value != “0″) {
location=form.select.options[index].value;}}
</SCRIPT>
<FORM NAME=”form1″>
<SELECT NAME=”select” ONCHANGE=”goto(this.form)” SIZE=”1″>
<OPTION VALUE=”">——-Choose a Selection——</option>
<OPTION VALUE=”index.html”>Home
<OPTION VALUE=”main_page.html”>Main page
<OPTION VALUE=”contact.htm”>Contact us
</SELECT>
</FORM>
