W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2008

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

From: Markus Ernst <derernst@gmx.ch>
Date: Thu, 04 Dec 2008 12:45:17 +0100
Message-ID: <4937C2CD.6040300@gmx.ch>
Eduard Pascual schrieb am 29.10.2008 18:37:
> On Wed, Oct 29, 2008 at 9:49 AM, Markus Ernst <derernst at gmx.ch> wrote:
>> Consider a form with some quite big radio button groups, and now you have do
>> add some more options. After you are done, your boss says: "Ok, great
>> work... but this looks too ugly now, just change it into those dropdown kind
>> of things."
> Honestly, this seems like a presentational issue to me. Isn't CSS3's
> Basic UI module (http://www.w3.org/TR/css3-ui/) enough to handle that?
> Correct me if I'm wrong, but it seems that the properties there would
> allow you to present a radiobutton group as a dropdown menu, and
> vice-versa.

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. 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.

Now consider some elements written by an even more stupid author:

<select name="gender" style="appearance:password">

<input name="field10" type="text" style="appearance:radio-group">

<fieldset style="appearance:field">
   [some checkboxes...]

...
Received on Thursday, 4 December 2008 03:45:17 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:46 UTC