Forum Moderators: open
<snip>
In my menus I have a few categories such as software, hardware and electronics. This is placed in one menu. I would like for the user to be able to click and select software and then, an adjacent jump menu will load the options for "software" such as MS office, Norton...etc. This means that if the user clicks hardware in the first menu, the adjacent jump menu will then load the options for hardware.
Would appreciate any help! Thanks so much!
[edited by: NFFC at 6:55 am (utc) on Sep. 23, 2002]
[edit reason] URL removed [/edit]
Firstly, URLs to sites are not allowed in posts. A moderator will snip it out soon. You can put the URL in your profile instead and ask people to look for it there ;)
You can use the onChange event of the select element to call a function.
For example, the pull down menu in your current site includes this line:
<select name="menu1" onChange="MM_jumpMenu('parent.frames[\'mainFrame\']',this,1)"> You could add to it like this so it calls a JavaScript function "changeOtherMenu" as well:
<select name="menu1" onChange="changeOtherMenu(); MM_jumpMenu('parent.frames[\'mainFrame\']',this,1)"> Then all you need to do is write your own JavaScript function "changeOtherMenu" and make it change the options in the other menu.
Be aware that some of these sites refresh the whole page when you make a selection from the first menu: they are using server-side scripting (eg ASP, JSP, PHP etc) to populate the second menu. Sites that don't refresh the whole page are using client-side scripting (JavaScript).
HTH