Thursday, March 3, 2011

Variable (dynamic) OPTION lists in HTML SELECT using IE

I'm trying to implement a dynamic OPTION list in JavaScript. Depending on other selections in the web form, some of the OPTIONS in a specific SELECT are not valid. Things I've tried that don't work in IE are:

  • populate all options, then set the disabled property for those that are invalid
  • populate all options and use option groups, then disable invalid option groups
  • I even tried using a style of text-decoration:line-through

At this point I'm resigned to repopulating the SELECT with only valid OPTIONs, but it seems like there ought to be a better way that actually works in IE. I require compatibility with IE6 and up. How have you dealt with this?

From stackoverflow

0 comments:

Post a Comment