Master Slave comboboxes.
1. set up the secondary options in a group
group[0][0] = new Option("some option", 14)
group[0][1] = new Option("another option" 23)
group[1][0] = new Option("next set", 32)
group[1][1] = new Option("more options", 22)
2. Tie the first combobox to a onchange event eg:
<select name="Area" size="1" onChange="redirect(this.options.selectedIndex)">
3. Make the onchange event change the second combobox. (named temp in this example)
-
function redirect(x){
-
// delete previous options.
-
for (m=temp.options.length-1;m>=0;m--){
-
temp.options[m]=null;
-
}
-
-
// set new options
-
for (i=0;i<group[x].length;i++){
-
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
-
}
-
//set first one by default.
-
temp.options[0].selected=true
-
}
-
Common request.