Pentium10
Pentium10

Reputation: 207912

The <option> disabled attribute is not supported in IE, prior version 8. Any workaround?

The disabled attribute is not supported in IE, prior version 8 for HTML <option> disabled Attribute. http://www.w3schools.com/tags/att_option_disabled.asp

What options do we have to customize the look and make the field read only?

Warning! Read the question twice, as we don't ask about <input disabled> we ask about <option disabled>

Upvotes: 2

Views: 1885

Answers (2)

Tomalak
Tomalak

Reputation: 338228

"The disabled attribute is not supported in IE, prior version 8 for HTML disabled Attribute."

This is entirely untrue.

Even IE7 dims an <option disabled> element and prevents selecting it (IE6 however doesn't).

Upvotes: 1

Ja͢ck
Ja͢ck

Reputation: 173572

My only suggestion (and this is not tested at all) would be to add an event handler on the <option> tag and have it return false; to prevent it from being selected.

Alternatively, you could hook onto the select onchange handler and revert to the old value when the selected value is not supposed to be clicked. Browsers that do support disabled will not be affected, so that might work for you.

Upvotes: 0

Related Questions