Log in

View Full Version : I'm trying to create a select box in a form with unselectable options



jc_gmk
05-15-2007, 02:27 PM
Help...

I'm trying to create a select box in a form with unselectable options.
It works fine in Mozilla but not IE.
This is how i'm coding it...


<form>
<select>
<option disabled="disabled">UNSELECTABLE OPTION</option>
<option value="something">SELECTABLE OPTION 1</option>
<option value="something">SELECTABLE OPTION 2</option>
<option value="something">SELECTABLE OPTION 3</option>
</select>
</form>


I have seen it done using the <OPTGROUP> tag but just gives me a heading LIKE THIS which i'm unable to change the style of using css.

Any suggestions?

codeexploiter
05-16-2007, 07:32 AM
Actually the disabled option in select object have some kind of bug in IE. You can read more details about the problem in the following articles. The article even propose some solution for the problem.

Article One (http://www.lattimore.id.au/2005/06/18/disable-options-in-a-select-dropdown-element/)

Article Two (http://www.lattimore.id.au/2005/07/01/select-option-disabled-and-the-javascript-solution/)

Hope this will help you.