[whatwg] optgroup element used for selection

Markus Ernst derernst at gmx.ch
Mon Apr 13 05:19:07 PDT 2009


Randy Drielinger schrieb:
> Currently (HTML4.01) and in the near-future HTML5 spec optgroup elements 
> are used to group options (hence the name :-) and amongst others allow 
> us to disable a group of option elements at once.
>  
> Personally, I think it would make sense to add the ability to make an 
> optgroup selectable. The result *could* be to select all the childs of 
> that optgroup element (or simply post the child values as an array or 
> whatever).
>  
> I've searched through the archive and only found discussions regarding 
> nested optgroups.
>  
>  
> In a form submission case it would make sense as optgroups are used to 
> subcategorize options. If optgroups are used in for example search pages 
> on websites, it would allow users to only select an optgroup to select 
> all of it's childs in, as an example, the following scenario:
>  
> <select>
>  <optgroup label="Excel">
>    <option label="Excel 2000">Excel 2000</option>
>    <option label="Excel 2002">Excel 2002</option>
>    <option label="Excel 2003">Excel 2003</option>
>    <option label="Excel 2007">Excel 2007</option>
>  </optgroup>
>  <optgroup label="Word">
>    <option label="Word 2000">Word 2000</option>
>    <option label="Word 2002">Word 2002</option>
>    <option label="Word 2003">Word 2003</option>
>    <option label="Word 2007">Word 2007</option>
>  </optgroup>
> </select>
>  
> Would all of the above make sense? Or don't y'all encounter issues 
> related to form usability at the moment?

The idea looks good to me, while I am not familiar with possible earlier 
discussion of it. Anyway this behaviour should be restricted to select 
elements with a "multiple" attribute, where multiple selections are 
allowed at all.



More information about the whatwg mailing list