I am trying to use two select and go navigation menus on one page, however only the first of the two works (the second does nothing). I have even tried giving each menu a different ID then changing the javascript to incorporate this with no success. Then instead of adding to the javascript, I used two separate external javascript files, one for each menu, still with no success.
Any suggestions how I could get both menus to work on the same page?
index.htm
Select_And_Go_Navigation.js
Thanks,
Chris
Any suggestions how I could get both menus to work on the same page?
index.htm
Code:
<HEAD>
<SCRIPT SRC="Select_And_Go_Navigation.js"></SCRIPT>
</HEAD>
<SELECT CLASS="Menu" ID="Select_And_Go_Menu">
<OPTION VALUE="#">>>>>></OPTION>
<OPTION VALUE="[URL unfurl="true"]http://www.google.com">Google</OPTION>[/URL]
<OPTION VALUE="[URL unfurl="true"]http://www.yahoo.com">Yahoo</OPTION>[/URL]
<OPTION VALUE="[URL unfurl="true"]http://www.altavista.com">Alta[/URL] Vista</OPTION>
</SELECT>
<SELECT CLASS="Menu" ID="Select_And_Go_Menu">
<OPTION VALUE="#">>>>>></OPTION>
<OPTION VALUE="[URL unfurl="true"]http://www.google.com">Google[/URL] 2</OPTION>
<OPTION VALUE="[URL unfurl="true"]http://www.yahoo.com">Yahoo[/URL] 2</OPTION>
<OPTION VALUE="[URL unfurl="true"]http://www.altavista.com">Alta[/URL] Vista 2</OPTION>
</SELECT>
Select_And_Go_Navigation.js
Code:
window.onload = initForm;
window.onunload = function() {};
function initForm() {
document.getElementById("Select_And_Go_Menu").
selectedIndex = 0;
document.getElementById("Select_And_Go_Menu").
onchange = jumpPage;
}
function jumpPage() {
var newLoc = document.getElementById("Select_And_Go_Menu");
var newPage = newLoc.options[newLoc.selectedIndex].value;
if (newPage != "") {
window.location = newPage;
}
}
Thanks,
Chris