0

I previously made this post regarding hiding an option from other select boxes when it is selected.

However I've just started testing my application in other browsers and I've found that IE doesn't support the .hide() function.

Is there an alternative method I could use for hiding the option in the other selects? I don't want to remove it as if the user was to change the value of the initial select then I'd need to the initial selected option to re-appear.

Anyone any ideas?

Community
  • 1
  • 1
CPB07
  • 679
  • 3
  • 13
  • 23
  • I'm very surprised you're having problems with `hide()`, but instead try `.css("display", "none")` – Reinstate Monica Cellio Apr 30 '13 at 14:47
  • Which version of IE? Which version of jquery? Maybe the problem don't come from the hide function, but from the selectors. – Getz Apr 30 '13 at 14:53
  • The only alternatives are to remove it from the select, or to not use a select. Styling input elements vary from browser to browser. – Kevin B Apr 30 '13 at 14:53
  • IE9 but I've used developer tools to try it in 8 and 7, calling jQuery v1.7.2. It works fine in both Firefox and IE and I've been trying to trouble shoot it since yesterday and the only thing I could find from looking online etc is that .hide doesn't seem to work in IE :-S – CPB07 Apr 30 '13 at 14:58

1 Answers1

0

Setting display on option elements isn't supported cross-browser.

As you're not wanting to remove the element from the select, there's a solution in the accepted answer here which may well work for you:

jQuery disable SELECT options based on Radio selected (Need support for all browsers)

Community
  • 1
  • 1
Town
  • 14,706
  • 3
  • 48
  • 72