[whatwg] Make radio button group suffering from being missing

Anne van Kesteren annevk at opera.com
Mon Nov 29 07:15:03 PST 2010


On Thu, 04 Nov 2010 01:20:37 +0100, Mounir Lamouri  
<mounir.lamouri at gmail.com> wrote:
> Currently, when a radio button is required, it will suffer from being
> missing if no radio elements in the radio button group is checked.
> However, radio elements in the group will not suffer from being missing
> if they do not have the required attribute. In other words, if you try
> to style invalid elements with :invalid, and do:
> <input type='radio' name='s' value='M' required>
> <input type='radio' name='s' value='F'>
> only the first element will be styled.
>
> I think we should move the requirement to the radio button group that
> way: "The radio button group suffers from being missing if one of the
> input elements in the radio button group is required and all of them
> have a checkedness that is false." and radio elements would have this
> constraint: "If the radio button group is suffering from being missing,
> the element is suffering from being missing.".
>
> That way, all radio elements in the same radio button group will have
> the same validity state. That would be less annoying for authors and
> error proof while making things clearer (IMO).
>
> I'm thinking of implementing that for Gecko 2.0/Firefox 4 so I would
> like to know if you know any reason that would make the current behavior
> more appropriate than the one described here.

Do you have tests for this by any chance? I agree it makes sense to always  
treat them as a group.


-- 
Anne van Kesteren
http://annevankesteren.nl/



More information about the whatwg mailing list