Forum Moderators: open

Message Too Old, No Replies

pull down menus

         

josh_cle

6:44 am on Sep 23, 2002 (gmt 0)

10+ Year Member



Hello there, I'm new and I am creating a page which utilizes pull down menus. I hope my explanation below is clear enough to show what I mean.

<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]

Purple Martin

6:58 am on Sep 23, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi josh_cle, welcome to WW!

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.

josh_cle

1:50 am on Sep 24, 2002 (gmt 0)

10+ Year Member



Thanks for the reply! I am new to this board as well as to designing with such pull down menus and javascript. Is there a website which utilizes such pull down menus where I can then learn from them? Thanks again!

Purple Martin

2:06 am on Sep 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, there are heaps of websites with that sort of functionality. I'm not going to plug one, but I can give you an idea of where to look: when I was recently looking for a used car, I visited several sites advertising cars online, and they almost all used that sort of functionality: I'd select a car manufacturer from the first menu, and the second menu was then populated with the models made by that manufacturer. I've also seen similar functionality on many e-commerce sites where you enter country and state/county in two menus.

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