We determined in a previous question that many features of HTML SELECTs are not supported in IE. Is there an alternative widget that you would recommend from your experience that meets the following requirements?
- Respects the
contentEditableproperty (does not allow selection changes if true) - Respects the
disabledproperty of individual OPTIONs (shows them ‘grayed out’ or with strike-through font, and makes them un-selectable) - Supports Option Groups (
OPTGROUPelements) - Supports
styleoptions such asborderandmarginin theSELECTand all sub-elements - Supports dynamic add and delete of
OPTIONandOPTGROUPelements - Supports the above in IE version 6 and above
EDIT: As noted by @Joel Coehoorn, items 3 and 5 above are currently supported in IE. They are included here to make sure they are not overlooked in a replacement widget.
At last check IE6+ does support #3 and #5, and you can (mis)use OPTGROUP to work around most of the other items.
You can do this by having an optgroup with no options inside it, like this:
You can make the label anything you want, but the point is that you’ll end up with an item that looks like a normal option, but cannot be selected. That opens to the door to all kinds of fun:
That accounts for most of #1 & #2 in your list, anyway- at least the functional points.
The reason for ‘(mis)use’ is because this won’t pass most html validators. However, the trick does work on all major browsers.