Re: Request clarification: Does readonly apply to checkboxes and radio buttons?

Jukka K. Korpela wrote:

>>Although "readonly" could be useful for checkboxes and radio buttons,
>>the HTML 4.0 DTD has the comment:
>>
>> readonly    (readonly)     #IMPLIED  -- for text and passwd --
>>    
>>
>Although the restriction is, somewhat oddly, stated in a DTD comment only,
>it seems to me that it is intentional.
>
Looking at the comment in context:

  value       CDATA          #IMPLIED  -- Specify for radio buttons and checkboxes --
  checked     (checked)      #IMPLIED  -- for radio buttons and check boxes --
  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
  readonly    (readonly)     #IMPLIED  -- for text and passwd --

The DTD for <input> also implies that the "value" attribute is "for" 
<input type="radio"> and <input type="checkbox">, but no one is 
suggesting that "value" must be ignored for <input type="text"> or 
<input type="password">. To me, this suggests that the comments are not 
intended to be normative.

>Notice that the "disabled" attribute is defined for BUTTON, INPUT, OPTGROUP, OPTION, SELECT, and TEXTAREA but "readonly" for INPUT and TEXTAREA only. If the intent was to allow making checkboxes and radio buttons readonly, it would have not been logical not to allow that for SELECT and BUTTON too.
>
It's not logical to define "readonly" for <button>, <optgroup>, and 
<option>. What's the point in setting "readonly" on static controls?

The omission of "readonly" on <select> is noteable, but that may just be 
an oversight.

Received on Friday, 20 February 2004 09:29:56 UTC