W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2005

[whatwg] required attribute for checkbox/select

From: Matt Wright <mw@mattwright.com>
Date: Mon, 21 Feb 2005 14:47:24 -0700
Message-ID: <000001c5185e$ee430810$6a00a8c0@msa>
Sorry if these items have already been discussed on the mailing list, but I
searched the archives and didn't see anything. I had a couple suggestions
for the required attribute (section 2.7) in Web Forms 2.0.

1) For checkboxes, wouldn't it would make more sense from a web applications
standpoint if this applied to a checkbox group like radio buttons currently

	OLD: "For checkboxes, the required attribute shall only be satisfied
when the checkbox is checked."

	NEW: "For checkboxes, the required attribute shall only be satisfied
when one or more of the checkboxes in that checkbox group is checked."

If authors want the behavior currently specified in the draft, they simply
name that checkbox something different from all other fields in the form.

2) Why can't the required attribute apply to a select field?  It is common
for application designers to want to force the user to manually select an
option.  They will do something like <option value="">Please select a valid
option</option>. You could easily word the document to say that:

	NEW: "For select, the required attribute shall only be satisfied
when a non-empty option value is selected."

Or, you may not even need to re-word the document, but just remove select
from the list of unsupported controls, since the final catch-all of this
section explains "Any non-empty value satisfies the required condition,
including a simple whitespace character."


Matt Wright
Received on Monday, 21 February 2005 13:47:24 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:39 UTC