posted 20 years ago
I've two select boxes in a form, the first being a multiple select, with the following code so that it's "sticky" ie just click to select/unselect items rather than holding ctrl or shift.
function AdvancedSelect(j) {
var oDropDown = document.myform.myselect;
arrMyDropDown[j] = !arrMyDropDown[j];
for(var i=0;i<oDropDown.options.length;i++) {
oDropDown.options[i].selected=arrMyDropDown[i];
}
}
...
<select name="myselect" onChange="AdvancedSelect(this.options.selectedIndex);" multiple size="10">
...
</select>
I now need to populate the 2nd select box with options corresponding to selections which are stored in arrays.
i.e. if the user selects option 1 and 3 from the first select box, then the 2nd select box will be populated with data from arrays
data[1] and data[3]
the arrays are setup like.......
data [1] [0] = "bob"
data [1] [1] = "steve"
data [1] [2] = "dave"
data [1] [3] = "simon"
data [3] [0] = "paul"
data [3] [1] = "tom"
data [3] [2] = "mike"
I hope this is enough information of what I want to achieve, any examples would be very helpful.
Many Thanks