Script : Chained Select
Link : http://www.dynamicdrive.com/dynamici...menu/index.htm
Here is my question again.
How can I add one "select" when I use this script. I'm not really familiar with JS and when I trie to do it, it renders a "white select"...
I can not give a link to my script because I'm still testing locally. But this is what I do..
In the config.js
Code:
addListGroup("vehicles", "car-makers");
addList("car-makers", "Select a maker", "", "dummy-maker");
addList("car-makers", "Toyota", "Toyota", "Toyota");
addList("car-makers", "Honda", "Honda", "Honda");
addList("car-makers", "Chrysler", "Chrysler", "Chrysler", 1);
addList("dummy-maker", "Not available", "", "dummy-car");
addOption("dummy-car", "Not available", "");
addList("Toyota", "Select vehicle type", "", "dummy-toyota");
addList("Toyota", "Cars", "car", "Toyota-Cars");
//-- new select to add
addList("region", "Select your region", "", "dummy-region");
addList("region", "Brussels", "Brussels", "");
addOption("dummy-region", "Not available", "");
In the php page :
Code:
<body onLoad="initListGroup('vehicles', document.forms[0].make, document.forms[0].type, document.forms[0].model, document.forms[0].region)">
....
<form>
<table align="center"><tr>
<td>Select a vehicle: </td>
<td><select name="make" style="width:160px;"></select></td>
<td><select name="type" style="width:160px;"></select></td>
<td><select name="model" style="width:160px;"></select></td>
<td><select name="region" style="width:160px;"></select></td>
<td><input type="button" value="Reset" onClick="resetListGroup('vehicles')">
</tr></table>
</form>
So the problem is that the "region" doesn't depend of the cars but should be "reset" at the same time..
thank you
Bookmarks