This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 15703 - ":required" pseudo selector for a radio button group
Summary: ":required" pseudo selector for a radio button group
Status: CLOSED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Robin Berjon
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords: a11y, a11ytf
Depends on: 16061
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-25 03:13 UTC by Kent Tamura
Modified: 2014-05-28 17:50 UTC (History)
8 users (show)

See Also:


Attachments

Description Kent Tamura 2012-01-25 03:13:12 UTC
http://dev.w3.org/html5/spec/Overview.html#selector-required
> :required
>   The :required pseudo-class must match any element falling into one of the following categories:
>    - input elements that are required

According to this definition, radio1 in the following example is not matched to ":required" though radio1 is invalid.  I think it's inconsistent and we had better add an exceptional rule for radio button groups.

<form>
<input type=radio name=group1 id=radio1>
<input type=radio name=group1 required>
</form>
Comment 1 Marat Tanalin | tanalin.com 2012-01-25 11:27:41 UTC
By the way, radio buttons is a case where having @required attribute for fieldset would be handy:

<fieldset required>
	<input type="radio" name="group1" id="radio1" />
	<input type="radio" name="group1" />
</fieldset>

So we could use FIELDSET:required instead of INPUT:required.
Comment 2 contributor 2012-07-18 06:54:43 UTC
This bug was cloned to create bug 17818 as part of operation convergence.
Comment 3 Michael[tm] Smith 2012-10-22 07:30:10 UTC
Hixie moved upstream bug 17818 for this to resolved=wontfix with this comment:

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17818#c1

"This would require "spooky action at a distance" in selectors. I think if you want :required to match, it's reasonable to require you to set the attribute also."

I'd suggest doing the same for this bug.
Comment 4 Michael Cooper 2013-01-16 14:50:21 UTC
Note this appears to be addressing the same use case as 16061, so adding dependency. Not expressing an opinion between them but they should be resolved together.
Comment 5 LĂ©onie Watson 2014-05-28 17:50:00 UTC
Closed by Bug Triage, per resolution for bug 16061:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=16061