Welcome to WebHeadStart.org

Web Technologies

Sponsored By

WebHeadStart.org is currently in beta.
Please pardon our appearance as we work to provide you with the most comprehensive reference on today's web technologies.

Interested in advertising on WebHeadStart? Become an advertising partner today!

[WWW-HTML Mailing List Archive Home] [Messages By Thread] [Messages By Date]

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
Valid XHTML 1.0! Valid CSS! Site Map | Privacy Policy | Terms of Use | WebHeadStart.org © 2005 All Rights Reserved.