W3C home > Mailing lists > Public > www-html@w3.org > February 2004

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

From: Robin Lionheart <w3c-ml@robinlionheart.com>
Date: Fri, 20 Feb 2004 09:25:59 -0500
Message-ID: <403618F7.90309@robinlionheart.com>
To: "Jukka K. Korpela" <jkorpela@cs.tut.fi>
Cc: www-html@w3.org

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

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:19:04 UTC