View Full Version : Chain Select Menu

09-15-2004, 10:32 AM
I have been trying to use a modified config.js chain select menu example from the dynamic drive updated download. I have been trying to use the checklist.js with this example, but the add option items do not show. Can anyone help tell me what I am doing wrong.

(My config.js file)

var disable_empty_list=true; //uncomment this line to disable empty selection lists

var onclickaction="alert" //set to "alert" or "goto". Former is for debugging purposes, to tell you the value of the final selected list that will be used as the destination URL. Set to "goto" when below configuration is all set up as desired.

var newwindow=0

addListGroup("music", "A");

addOption("A", "Select an artist from the A list", "", 1);
addList("A", "Albert Ayler", "", "Albert-Ayler");
addList("A", "Roy Ayers", "", "Roy-Ayers");
addList("A", "Nat Adderley", "", "Nat-Adderley");
addList("A", "Afro Cuban All Stars", "", "Afro-Cuban-All-Stars");
addList("A", "Azymuth", "", "Azymuth");

addOption("Albert-Ayler", "Select an artist album", "", 1);
addList("Albert-Ayler", "Albums", "", "Ayler-Album");

addOption("Ayler-Album", "Select an Album", "", 1);
addOption("Ayler-Album", "Going Home", "http://www.javascriptkit.com");
addOption("Ayler-Album", "Spirt", "");
addOption("Ayler-Album", "Love Cry", "");
addOption("Ayler-Album", "Vibration", "");
addOption("Ayler-Album", "New Grass", "");
addOption("Ayler-Album", "The Last Album", "");
addOption("Ayler-Album", "Spirt Rejoice", "");
addOption("Ayler-Album", "Albert Smile", "");

addOption("Roy-Ayers","Select an artist album", "", 1);
addList("Roy-Ayers", "Albums", "", "Ayers-Album");

addOption("Ayers-Album", "Select an Album", "", 1);
addOption("Ayers-Album", "Let's do it", "");
addOption("Ayers-Album", "Coffy", "");
addOption("Ayers-Album", "You Send Me", "");
addOption("Ayers-Album", "In the dark", "");
addOption("Ayers-Album", "Daddy's back", "");
addOption("Ayers-Album", "Naste", "");
addOption("Ayers-Album", "Spoken word", "");
addOption("Ayers-Album", "Feelin Good", "");
addOption("Ayers-Album", "Lots of Love", "");

(My sample.htm file)

<title>Chained Selects</title>

<script language="javascript" src="chainedselects.js">

* Chained Selects script- By Xin Yang (http://www.yxscripts.com/)
* Script featured on/available at http://www.dynamicdrive.com/
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code

<script language="javascript" src="exampleconfig5.js"></script>

<script language="javascript">
<script language="javascript">
function checkList(list, order, instance) {
alert("List Group Instance Order: "+instance+"\nSelect List Order: "+order+"\nOption Value: "+list.value);


<body onload="initListGroup('music', document.forms[0].firstlevel, document.forms[0].secondlevel);
initListGroup('music', document.forms[0].firstlevel, document.forms[0].secondlevel, checkList)">
<h2>Chained Selects Example I</h2>

<table align="center" cellpadding="0" cellspacing="0" border="0" width="90%"><tr><td>


<tr><td colspan="3">Select an Artist:</td></tr>
<td><select multiple size="12" name="firstlevel"></select></td>
<td><select multiple size="12" name="secondlevel"></select></td>

<tr><td colspan="3"><input type="button" value="Reset" onclick="resetListGroup('music')"></td></tr>



Thanks in advance