Bug 16061 - Required edit should be applicable to fieldset
Required edit should be applicable to fieldset
Status: CLOSED FIXED
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec
unspecified
PC Windows NT
: P2 normal
: ---
Assigned To: Léonie Watson
HTML WG Bugzilla archive list
: a11y, a11ytf
Depends on:
Blocks: 15703 16029
  Show dependency treegraph
 
Reported: 2012-02-21 16:36 UTC by Léonie Watson
Modified: 2013-05-16 16:32 UTC (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Léonie Watson 2012-02-21 16:36:58 UTC
When applied to a fieldset, the required attribute would indicate that all form fields within the set were required.

This would be particularly useful when a choice was required from a set of radio buttons.
Comment 1 Michael Cooper 2012-02-21 16:41:26 UTC
Clarification: If the fieldset encloses radio buttons, one of them must be checked. If the fieldset encloses checkoxes, one or more of them must be checked. If the fieldset encloses other fields, all of them are required. Basically, every unique field name enclosed by the fieldset must have a value.
Comment 2 Boris Zbarsky 2012-02-22 14:48:35 UTC
> This would be particularly useful when a choice was required from a set of
> radio buttons.

Why?  If @required is set on _any_ radio button in the set, then the entire set is required (in the sense that one of the radio buttons must be selected for the form to submit).  It doesn't have to be the one with the @required attribute on it.
Comment 3 Evert 2012-02-23 16:27:37 UTC
Would the way radiobuttons work with the required attribute also work with checkboxes? Suppose you have a group of checkboxes from which the user is required to select at least one? Wouldn't the required attribute be more flexible on the fieldset?


As a sidenote: I never understood why there had to be both a checkbox and a radiobutton. Perhaps a bit off-topic, but please consider:


1) a checkbox without a parent fieldset would be just a single checkbox.
2) A group of checkboxes in a fieldset with multiple=false would be a group of radiobuttons
3) A group of checkboxes in a fieldset with multiple=true would be a group of checkboxes
4) If fieldset has required set then at least 1 choice must be made from the checkboxes.
5) optionally: required=x where x is an integer denoting the amount of choices the user must make minimally.

All this would be backward compatible (or could at least be made so).
Comment 4 Boris Zbarsky 2012-02-23 16:55:35 UTC
> Would the way radiobuttons work with the required attribute also work with
> checkboxes?

No.

> Suppose you have a group of checkboxes from which the user is
> required to select at least one?

That's basically what <select multiple required> gives you.  I agree that having a way to do that with checkboxes would be good, but I don't see why it should depend on fieldsets....
Comment 5 Evert 2012-02-23 17:12:38 UTC
> 
> I agree that
> having a way to do that with checkboxes would be good, but I don't see why it
> should depend on fieldsets....

I am not saying it should. It is just a proposal using what we have in a non-conflicting way (as far as I can see).
I agree with you that select gives us the functional ability and in hindsight it would have been better if radiobuttons, checkboxes and selectboxes would have been condensed into 1 element, but that is not how it is. Add to that the inability of browsers to let us restyle form elements any way we want in an easy and consitent way and I think a bit more flexibility in how we can use fieldsets and checkboxes would go a long way.
But I may be a minority, I do not know.
Comment 6 contributor 2012-07-18 06:56:14 UTC
This bug was cloned to create bug 17827 as part of operation convergence.
Comment 7 Edward O'Connor 2012-09-21 23:27:09 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are
satisfied with this response, please change the state of this bug to CLOSED. If
you have additional information and would like the editor to reconsider, please
reopen this bug. If you would like to escalate the issue to the full HTML
Working Group, please add the TrackerRequest keyword to this bug, and suggest
title and text for the tracker issue; or you may create a tracker issue
yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: No spec change.
Rationale: See comments 2 and 4.
Comment 8 steve faulkner 2013-04-06 15:21:19 UTC
after re-reading this bug I think it should be closed, with the current resolution accepted.

It was re-opened by the a11y taskforce, but I don't see anything specific to accessibility about it and the resolution seems reasonable.

This sounds like a new feature request and anybody interested in pursuing should follow up with implementers.