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
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

It seems that the DOM group has taken this to as an explicit restriction,
since DOM2's HTML spec
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 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:06:04 UTC