Click to See Complete Forum and Search --> : Multiple JS Drop-Down Scripts-One Working
MaineWebGirl
03-12-2003, 11:31 AM
I have two javascript drop-down menus on this page. It does not matter which submit button I hit, it runs the first one. I have tried giving the second script a new name, but it doesn't seem to help.
Attached is an example. Thanks for your help!
MaineWebGirl
03-12-2003, 11:32 AM
Sorry, forgot to attach file.
khaki
03-12-2003, 11:33 AM
Hi MaineWebGirl...
The attachment didn't "stick".
Try it again (I think you can go to "edit" to access your original post on this).
k
khaki
03-12-2003, 11:36 AM
Hi MaineWebGirl...
You need to name then uniquely.
(the forms, i mean. and the select name too, if you don't want to confuse yourself)
k
Here (I was being lazy before)
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<form name="jump1">
<select name="menu1">
<option value="http://www.tudogs.com">Example 1</option>
<option value="http://www.mainresource.com">Example 1a</option>
<option value="http://www.myheadsets.com">Example 1b</option>
</select>
<input type="button" onClick="location=document.jump1.menu1.options[document.jump1.menu1.selectedIndex].value;" value="GO">
</form>
<form name="jump2">
<select name="menu2">
<option value="http://www.yahoo.com">Example 2</option>
<option value="http://64.179.21.94">Example 2a</option>
<option value="http://www.half.com">Example 2b</option>
</select>
<input type="button" onClick="location=document.jump2.menu2.options[document.jump2.menu2.selectedIndex].value;" value="GO">
</form>
</BODY>
</HTML>
MaineWebGirl
03-12-2003, 11:50 AM
I was just writing to confess that I didn't exactly know what to rename. You were too fast for me. Thanks so much for your help.