QuickJump Menu (link launcher)

From ClubsWiki
Jump to: navigation, search

This dropdown menu uses a little JavaScript to quickly jump to another URL. The menu must be contained inside a web form, but no <script></script> JavaScript needs to be in the header or body. The QuickJump menu can stand alone and takes the URL from the selected value.

Code:

<select name="menuname" onChange="location=document.formname.menuname.options[document.formname.menuname.selectedIndex].value;">

The code above will work for a form called "formname" and a menu called "menuname" as in the complete form code below. If you change your form or menu name, you must change the onChange="location= to match.

Complete Code:

<form name="formname">
<select name="menuname" onChange="location=document.formname.menuname.options[document.formname.menuname.selectedIndex].value;">

<option value=" " selected>QuickJump Menu</option>
<option value=" ">---------------------------</option>
<option value="http://www.mywebsite1.com">website 1</option>
<option value="http://www.mywebsite2.com">website 2</option>
<option value="http://www.mywebsite3.com">website 3</option>
  </select>
</form>
Personal tools