hide() not working in IE

前端 未结 6 421
你的背包
你的背包 2021-01-25 19:31

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

6条回答
  •  一向
    一向 (楼主)
    2021-01-25 20:16

    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.

提交回复
热议问题