I am using the code below so that a drop down menu will allow users to choose and item from a list. The links should the navigate to an external website.
However, the code I am using tries to open the link from within my site.
For example, an item from my drop down would be Yahoo. When you click on Yahoo, it looks for yahoo.com in my site as though yahoo were a page in my site, not the actual yahoo.com. Please see the code below.
However, the code I am using tries to open the link from within my site.
For example, an item from my drop down would be Yahoo. When you click on Yahoo, it looks for yahoo.com in my site as though yahoo were a page in my site, not the actual yahoo.com. Please see the code below.
Code:
<script language="JavaScript"> <!-- function goToURL(form) { var myindex=form.dropdownmenu.selectedIndex if(!myindex=="") { window.location.href=form.dropdownmenu.options[myindex].value; } } //--> </script> <!--Paste code above between your head tags--> <!--Paste code below between your body tags--> <form name="Choose One"> <select name="dropdownmenu" size=1 onChange="goToURL(this.form)"> <option selected value=""> Choose One <option value="www.arisnyc.org"> ARIS <option value="www.yahoo.com"> Yahoo <option value=""> <option value=""> <option value=""> </select></form>
Comment