[whatwg] [wf2] disabled attribute (option, optgroup elements)

Anne van Kesteren fora at annevankesteren.nl
Wed Jul 27 04:53:15 PDT 2005


"The term form control refers to input, output, select, textarea and button 
elements. It does not include form, label, datalist, option or fieldset
elements."

(OPTGROUP should probably be mentioned here, not?)

"The disabled attribute applies to all form controls except the output  element,
and also to the fieldset element."

In HTML 4 it also applied to the OPTION and OPTGROUP elements.
 <http://www.w3.org/TR/html4/sgml/dtd.html>

Implementations differ at the moment. For OPTION, take this document:

# <!DOCTYPE html>
# <form method="get">
#  <select name="s1"><option disabled>fail<option>pass</select>
#  <button type="submit" name="s1">test</button>
# </form>

Firefox shows 'pass' directly. It is impossible to select 'fail' or to submit
it. When viewing the dropdown menu it is visible in disabled style.

Opera shows 'fail' directly in disabled style. It is possible to select 'fail'
but on submitting no value is passed to the request.

IE does not care. IE does not show 'fail' in disabled style and IE does submit
'fail'.

Adding OPTGROUP to the mix does not give much different results:

# <!DOCTYPE html>
# <form method="get">
#  <select name="s1">
#   <optgroup disabled><option>fail<option>test</optgroup>
#   <optgroup><option>pass</optgroup>
#  </select>
#  <button type="submit" name="s1">test</button>
# </form>

Opera does everything the same although it is now no longer possible to seelct
'fail' or 'test'.

Firefox and IE act identically.

So the definition of the disabled content attribute should be changed and
perhaps some other things should be clarified as well. This was merely a
survey.


-- 
Anne van Kesteren
<http://annevankesteren.nl/>




More information about the whatwg mailing list