W3C home > Mailing lists > Public > www-html@w3.org > June 2003

Request clarification: readonly when type="checkbox" or "radio"

From: Robin Lionheart <w3c-ml@robinlionheart.com>
Date: Tue, 24 Jun 2003 11:16:09 -0400
Message-ID: <014e01c33a63$ad120b00$117de518@prolog021503my>
To: <www-dom@w3.org>, <www-html@w3.org>

In the Bugzilla forums for Mozilla, there is some confusion about whether
checkboxes and radio buttons can be set read-only.

The definition in HTML 4.01
(http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#adef-rea
donly) gives no indication that checkboxes and radio buttons cannot be set
read-only. It reads, "When set for a form control, this boolean attribute
prohibits changes to the control." and says, "The following elements support
the readonly attribute: INPUT and TEXTAREA."

The HTML 4.01 DTD has the comment:
   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 --

However, the value attribute clearly applies to text fields as well as radio
buttons and checkboxes, so it's unclear how 'for text and passwd' is to be
taken.

It seems that the DOM group has taken this to as an explicit restriction,
since DOM2's HTML spec
(http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-884615
92) has:

    readOnly of type boolean
    This control is read-only. Relevant only when type has the value "text"
    or "password". See the readonly attribute definition in HTML 4.01.

It seems obvious that read-only is irrelevant for types of "hidden"
and the various button types "submit", "reset", "image", and "button".

But why is it not relevant for "checkbox", "radio", or "file"?

Is a limitation intended, or just an oversight? Please clarify.
Received on Tuesday, 24 June 2003 11:13:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:55 GMT