I have a select box with 4 values (a,b,c,d). I just want to disable 'c' inside the dropdown. I used disabled property, it is working in all browsers but not in IE6.
I want to make it work on IE6. Could you give me some fix for this issue.
thanks
I have a select box with 4 values (a,b,c,d). I just want to disable 'c' inside the dropdown. I used disabled property, it is working in all browsers but not in IE6.
I want to make it work on IE6. Could you give me some fix for this issue.
thanks
Unfortunately, I don't think it is possible. The work-around I've used in the past was to set the color of options that should be disabled to grey, and if one of those options were selected, I'd deselect it immediately using onchange().
The disabled attribute for the option element is completely unsupported by any version of Internet Explorer.
This page explains it: http://www.w3schools.com/TAGS/att_option_disabled.asp
In order to develop a proper workaround for IE, you need to explain your situation in how the select menu is being used. Using the onchange() function is not recommended because that implies requires the user actually have JavaScript enabled in order for it to work. The easiest thing to do would be to just completely remove that option from the select menu if you don't want anyone to select it. You should not be using the disabled attribute at all. It's simple: if you don't want someone to select it, don't put it in the list.