I wanted a drop list, when the users picked an item, it automatically went to it instead of having hit a button. I found a script that worked:
<script language=JavaScript>function Navigate() {var number = NavSelect.selectedIndex;location.href = NavSelect.options[number].value; }</script> <select name="NavSelect" onChange="Navigate(this.form)"> <option value="" selected>Quick Select</option> <option value="prod1.php">product 4/option> <option value="prod2.php">product 3</option> <option value="prod3.php">product 3</option> </select>
4/7/2009 1:48:18 PM
nmind you wanted a list[Edited on April 7, 2009 at 2:06 PM. Reason : .]
4/7/2009 2:06:11 PM
^^aren't you missing the form tags so you can reference it with...document.formName.elementName
4/7/2009 2:24:25 PM
can probably look through the source of TWW and just do what it does
4/7/2009 2:33:37 PM
if i'm understanding what you want to do right all you have to do is...window.location = document.formName.formElementName.valueand that will work in all browsers.
4/7/2009 2:34:59 PM
did away with the function and just used it within the form code. This worked for me:
<form name="f2"><select name="NavSelect" onChange="window.location=document.f2.NavSelect.options[document.f2.NavSelect.selectedIndex].value">..
4/7/2009 2:51:55 PM
^you don't need the .options.etc.etcwhen you select an option in the drop down the value of the dropdown becomes the value of the option.so document.f2.NavSelect.value would work too.
4/7/2009 2:55:19 PM