PDA

View Full Version : Using the options in a drop box as links


Nasith
08-09-2002, 08:06 PM
How do I set the options in drop down boxes so that they are links to other pages?

requestcode
08-09-2002, 08:27 PM
Here is an example:
<HTML>
<HEAD>
<TITLE>Drop Down Test</TITLE>
<SCRIPT LANGUAGE="javascript">
function LinkUp(linkid)
{
location.href=linkid
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="lightblue" onLoad="document.DropDown.reset()">
<FORM NAME="DropDown">
<SELECT NAME="DDlinks" onChange="LinkUp(this.options[this.selectedIndex].value)" >
<OPTION SELECTED>Select One
<OPTION VALUE="maxtext8.htm"> Page One</OPTION>
<OPTION VALUE="newwin.htm"> Page Two</OPTION>
<OPTION VALUE="open.htm"> Page Three</OPTION>
</SELECT>
</FORM>
</BODY>
</HTML>

Also if you check the Free Scripts Section at http://www.javascriptkit.com you should find more.

Nasith
08-09-2002, 08:56 PM
thanks