Forum Moderators: open
Can anyone help me with the following problem.
I have two dropdown lists, and depending on the option selected in the first one i need to either remove or disable some of the options in the second so that they cannot be selected. I can check the values of the first dropdown list, but I am not sure how to go about doing the second bit. Any help would be much appreciated.
Thanks
antenc
and a warm welcome to these forums. ;)
This is what my reference book has to say about option attribute - disabled...
'The presence of this attribute disables the options element in the list.
Note that although the attribute disables the list choice in IE 5/Mac, as of
Version 6, IE/Windows provides no other functionality for this attribute.'
... in other words there will be, unfortunately, no cross browser compatibilty. :(
birdbrain
i need to either remove or disable some of the options
..that leaves the first option - of removal.
Try using the DOM method, removeChild, from the select element.
If you need more guidance, perhaps you could post the markup for the two drop-downs, and an indication correlation of selections to removed options, so we have something to work with. (cut down demo, if need be)