Forum Moderators: open

Message Too Old, No Replies

Javascript dropdown menus

         

heymonkey

12:06 pm on Jul 30, 2005 (gmt 0)

10+ Year Member



I'm in the process of putting 2 dropdown menus on my site. When an item is selected on the 1st menu the second dropdown changes without reloading the page. I've basically copied the html and ammended it all and it works really well. Only problem is, when selecting from the second menu I don't know how to get it to link to another page! It's probably really simple.
I've tried copying text from other forums but they don't seem to work with my html.
I've put parts of the text below:

<td colspan="5"><form name="MyForm">
<p><select name="primary" size="1"
onchange="javascript:MakeSecondary()">
<option value>QUICK NAVIGATION - Select a Category</option>
<option value="AP">Airliner Pins</option>

var FormName = "MyForm";

var initSubLine = "Select a category from the left dropdown";

var APArray = new Array();
APArray[0] = "-- Select an Airliner Type --";
APArray[1] = "Boeing 707¦707TP.htm";
APArray[2] = "Boeing 737¦737TP.htm";
APArray[3] = "Boeing 747¦747TP.htm";
APArray[4] = "Airbus A300¦A300TP";
APArray[5] = "Concorde Gold¦concgoldTP.htm";
APArray[6] = "Concorde Silver¦concsilTP.htm";

As you can see I've made the secondary values links, nut not sure of the next step.

Any help would be greatly received! I've tried asking the site where I got the html and instructions from but no reply as yet and I'm a bit of a hurry!

If anyone needs to see more of the html - the link is:
<Sorry, no personal URLs.
Please see Forum Charter [webmasterworld.com]>

[edited by: tedster at 8:58 pm (utc) on July 30, 2005]

garann

8:01 pm on Aug 1, 2005 (gmt 0)

10+ Year Member



It seems you've got kind of a random sampling of your code there, but from what I see, I think this might work for you. You'd want to add it as an attribute to your second dropdown:

onchange="location.href=this.value.split('¦')[1];"