PDA

View Full Version : two select menus on same page



chechu
03-25-2009, 01:21 PM
1) Script Title: chained select menu

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex1/chainedmenu/index.htm

3) Describe problem: how is it possible to have two menus on the same page, please ?

jenson
03-25-2009, 02:31 PM
Hey chechu,

I just copied the config.js and renamed it to config2.js...
Then i changed the values in config2.js the way i wanted it and included the
new js script in my form.

It works perfectly.
But i don't know if this is the best way to get another chained select?!?!?!?


Because you also working with the chained select sript, you maybe could give me an answer to my question?
http://www.dynamicdrive.com/forums/showthread.php?t=43233

Thanks in advance...

jenson

chechu
03-25-2009, 04:21 PM
What do I need to change in the form ?

<form name="listmenu0">
<select name="firstlevel"></select>
<select name="secondlevel"></select><br>
<select name="thirdlevel"></select>
<select name="fourthlevel"></select><br>
<select name="fifthlevel"></select>
<input type="submit" value=" bekijk je keuze" onclick="goListGroup(document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, document.listmenu0.fourthlevel, document.listmenu0.fifthlevel)">
</form>
Can you place your code here of the two forms you have on the same page, please ?

Can't help you with your question regarding MySQL; never used it.

jenson
03-25-2009, 05:18 PM
Hey chechu,

unlike you, i put the "onclick" element into the <body> tag.

Mine Body Tag looks like this:



<body bgcolor="#72144F"
onload="initListGroup('chainedmenu', document.Formular.WGR, document.Formular.UGR, document.Formular.TYP);initListGroup('chainedmenu_2', document.Formular.LF, document.Formular.HERKUNFT,document.Formular.LFARTGRP)" link="#72144F" vlink="#72144F" alink="#72144F">


In my form config.js belongs to 'chainedmenu' and config2.js belongs to 'chainedmenu_2'....

This is the name you need to define in the config.js.
If you don't rename the menue in config2.js, only one chained select menue will be activated.

Greetz

jenson

chechu
03-25-2009, 08:05 PM
Okay, so you use the body onload as you attached. But how does the form know what chainedmenu to follow ? Can you please place a link to your site where you use this, so I can have a look at your codes. Thanks.

chechu
03-30-2009, 03:13 PM
Jenson, could you please paste your codes, here,
so I can have a look at them to find out what you mean. Thanks !