[whatwg] Select elements and radio button/checkbox groups [Was: Form Control Group Labels]

On Thu, 4 Dec 2008, Markus Ernst wrote:

> This CSS3 module is indeed an interesting approach, anyway I don't see 
> in this spec how possible conflicts between the form structure and it's 
> presentation can be avoided or handled. Start with:
> 
> <select name="gender">
>   <option value="f">Female</option>
>   <option value="m">Male</option>
> </select>
> 
> Now you can easily change the presentation into a radio button group, 
> which is fine:
> 
> <select name="gender" style="appearance:radio-group">
> 
> But then an author does this:
> 
> <select name="gender" style="appearance:checkbox-group">
> 
> Now there is a conflict, as the form structure allows only a single 
> selection, while the presentation allows a multiple one.

It's not clear that the underlying element can actually get multiple 
selections here (I would argue it cannot); but this is an issue for CSS3 
UI, not for HTML5.


> This does not only affect the rendering of the element and the reaction 
> to user actions, but is even likely to break the handling of the 
> submitted value, as server-side handlers often expect either a single 
> value or an array of values and are not configured to cope with both of 
> them.

A conforming browser wouldn't send values that violate the rules HTML5 
describes, which in this case prevents the scenario you describe, 
regardless of the presentation layer.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Friday, 24 April 2009 15:09:47 UTC