weby
10-11-2012, 04:13 PM
Hi,
Hope there is a JS genius out there who can help me, I am trying to include an extra selection box for the Xin's chained select menu, I have added and amended the HTML part (I think it is correct see below) but I have tried every way i can think of to alter the config-js code to load data into another selection box, I have replaced the contents with letters to make it easier to follow through. the script below allows me to select the primary letter as A, the secondary letter an A1 – I need to select the third letter as A2 etc etc, I need to do this maybe up to 8 times in total but modifying the config-js code is beyond my capabilities.
Any help appreciated.
Weby.:confused:
<html>
<head>
<script type="text/javascript" src="chainedmenu.js"></script>
<script type="text/javascript" src="config-1.js"></script>
</head>
<body onload="initListGroup('chainedmenu', document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, document.listmenu0.fourthlevel,'saveit')"> <!--this line amended to include fourth level-->
<table align="center" cellpadding="0" cellspacing="0" border="0" width="90%"><tr><td>
<form name="listmenu0">
<table align="center"><tr>
<td><select name="firstlevel" style="width:200px;"></select></td>
<td><select name="secondlevel" style="width:200px;"></select></td>
<td><select name="thirdlevel" style="width:200px;"></select></td>
<td><select name="fourthlevel" style="width:200px;"></select></td> <!--this line added-->
<td><input type="button" value="Go" onclick="goListGroup(document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, document.listmenu0.fourthlevel)"> <!-- this line amended to include fourth level-->
<input type="button" value="Reset" onclick="resetListGroup('chainedmenu')"> </td>
</tr></table>
</form>
</td></tr></table>
</body>
</html>
Config-js.
var disable_empty_list=true;
var onclickaction="goto"
var newwindow=0
addListGroup("chainedmenu", "First-Select");
addOption("First-Select", "Select an item", "", 1); //HEADER OPTION
addList("First-Select", "Select a letter", "", "Webmaster");
addOption("Webmaster", "Select Primary Letter", "", 1); //HEADER OPTION
addList("Webmaster", "A", "", "A Letter");
addList("Webmaster", "B", "", "B Letter");
addList("Webmaster", "C", "", "C Letter");
addList("Webmaster", "D", "", "D Letter");
addList("Webmaster", "E", "", "E Letter");
addOption("A Letter", "Select Secondary A Letter", "", 1); //HEADER OPTION
addOption("A Letter", "A1", "http://www.Google.co.uk");
addOption("B Letter", "Select Secondary B Letter", "", 1); //HEADER OPTION
addOption("B Letter", "B1", "http://www.Google.co.uk");
addOption("C Letter", "Select Secondary C Letter", "", 1); //HEADER OPTION
addOption("C Letter", "C1", "http://www.Google.co.uk");
addOption("D Letter", "Select Secondary D letter", "", 1); //HEADER OPTION
addOption("D Letter", "D1", "http://www.Google.co.uk");
addOption("E Letter", "Select Secondary E letter", "", 1); //HEADER OPTION
addOption("E Letter", "E1", "http://www.Google.co.uk");
Hope there is a JS genius out there who can help me, I am trying to include an extra selection box for the Xin's chained select menu, I have added and amended the HTML part (I think it is correct see below) but I have tried every way i can think of to alter the config-js code to load data into another selection box, I have replaced the contents with letters to make it easier to follow through. the script below allows me to select the primary letter as A, the secondary letter an A1 – I need to select the third letter as A2 etc etc, I need to do this maybe up to 8 times in total but modifying the config-js code is beyond my capabilities.
Any help appreciated.
Weby.:confused:
<html>
<head>
<script type="text/javascript" src="chainedmenu.js"></script>
<script type="text/javascript" src="config-1.js"></script>
</head>
<body onload="initListGroup('chainedmenu', document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, document.listmenu0.fourthlevel,'saveit')"> <!--this line amended to include fourth level-->
<table align="center" cellpadding="0" cellspacing="0" border="0" width="90%"><tr><td>
<form name="listmenu0">
<table align="center"><tr>
<td><select name="firstlevel" style="width:200px;"></select></td>
<td><select name="secondlevel" style="width:200px;"></select></td>
<td><select name="thirdlevel" style="width:200px;"></select></td>
<td><select name="fourthlevel" style="width:200px;"></select></td> <!--this line added-->
<td><input type="button" value="Go" onclick="goListGroup(document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, document.listmenu0.fourthlevel)"> <!-- this line amended to include fourth level-->
<input type="button" value="Reset" onclick="resetListGroup('chainedmenu')"> </td>
</tr></table>
</form>
</td></tr></table>
</body>
</html>
Config-js.
var disable_empty_list=true;
var onclickaction="goto"
var newwindow=0
addListGroup("chainedmenu", "First-Select");
addOption("First-Select", "Select an item", "", 1); //HEADER OPTION
addList("First-Select", "Select a letter", "", "Webmaster");
addOption("Webmaster", "Select Primary Letter", "", 1); //HEADER OPTION
addList("Webmaster", "A", "", "A Letter");
addList("Webmaster", "B", "", "B Letter");
addList("Webmaster", "C", "", "C Letter");
addList("Webmaster", "D", "", "D Letter");
addList("Webmaster", "E", "", "E Letter");
addOption("A Letter", "Select Secondary A Letter", "", 1); //HEADER OPTION
addOption("A Letter", "A1", "http://www.Google.co.uk");
addOption("B Letter", "Select Secondary B Letter", "", 1); //HEADER OPTION
addOption("B Letter", "B1", "http://www.Google.co.uk");
addOption("C Letter", "Select Secondary C Letter", "", 1); //HEADER OPTION
addOption("C Letter", "C1", "http://www.Google.co.uk");
addOption("D Letter", "Select Secondary D letter", "", 1); //HEADER OPTION
addOption("D Letter", "D1", "http://www.Google.co.uk");
addOption("E Letter", "Select Secondary E letter", "", 1); //HEADER OPTION
addOption("E Letter", "E1", "http://www.Google.co.uk");