My code works perfect in firefox and gives error in IE. any ideas?
I have a dropdown with various options, I am trying to show/hide options in another dropdown based on
I would suggest having two selects that you show and hide. Show and hide of options sounds risky.
Also, make sure you set the hidden select to attr('disabled','disabled')
/disabled="disabled"
and then when you unhide it undo that with removeAttr('disabled')
. This is to prevent the hidden select from posting data to the server when you have multiple selects with the same name="..."
.
If you must use a single select, you may want to appendTo
/remove
the options, but that is up to you. If show/hide works in all browsers, go for it.