View Full Version : Making a "list menu" or "jump menu" display a list
genevieve
Aug 8th 2005, 10:13 am
I am trying to make a menu that, instead of taking you to a different page, will display a list on the screen. I want to use a menu, it is usually a form item--drop down menu, sometimes called a "jump" menu, or in Dreamweaver it is called a list/menu. In the code, the items are called "options" and the menu is called "select." I work for a school district, and basically I want it so that the menu is a list of our locations, and when you select a location, a list of programs available at that location appears below without taking you to a new screen. Also, the list of programs that appear will all be links.
Is Javascript the way to do this, (and if so, how?) or is there a better way?
J.D.
Aug 8th 2005, 11:43 am
It would not be a trivial program, but you can do it either client-side (JS) or server-side (JS + PHP/ASP/etc).
1. In the first case, you will need to pull all possible choices and store them in a JS array. For example:
var applinks = new Array(0);
applinks.push(new AppLink(1, ...)); // 1st link, 1st group
applinks.push(new AppLink(1, ...)); // 2md link, 1st group
applinks.push(new AppLink(2, ...)); // 1st link, 2nd group
...
applinks.push(new AppLink(N, ...)); // Nth link, Nth group
Then, once the selection changes, you can clear out and populate some HTML element using this array using document.createElement (selecting those that match the group ID, for example).
2. You can do it server-side. In this case, once the selection changes, you will submit a form and on the server you will select only those links that match the submitted group and form a list.
J.D.
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.