|
Here’s what I've got:
I’ve got 2 <select> dropdowns. For each <option> in the top dropdown a 2nd dropdown is loaded but is hidden using CSS. On changing the top dropdown the requested 2nd dropdown is displayed [style.visibility = 'visible']. The only way I have been able to get the other dropdowns to disappear is to disable them and also set them to be hidden using javascript.
My problem:
This works, but the trouble with it is that it means with a lot of 2nd dropdowns you need many rows of JavaScript, 1 to hide/disable each 2nd dropdown. My idea to get around this is to somehow store the value of the currently displayed dropdown as a variable and then reference this to hide it when another selection is made from the 1st dropdown.
I can’t seem to retain the value of the variable though.
|
|
|
|
|
|
|
|