Re: [whatwg] optgroup element used for selection

2009-06-03 Thread Ian Hickson
On Thu, 9 Apr 2009, Randy Drielinger wrote:

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

This has been suggested previously also. I have noted it as a possible 
extension for a future version. I'd like to avoid adding new features at 
this point so that we can get HTML5 out of the door. :-)

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


Re: [whatwg] optgroup element used for selection

2009-04-13 Thread timeless
Personally i'd rather that a UA be able to choose to do this on its
own. I don't think it requires a change to the specification.

you're talking more about a behavior (clicking X triggers Y and Z)
than how the web page sees what happened (either way it only sees
triggers on Y and Z).

I've actually been poking this widget a couple of ways recently and
things like this have come to mind.


Re: [whatwg] optgroup element used for selection

2009-04-13 Thread Markus Ernst

Markus Ernst schrieb:

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 2000Excel 2000/option
   option label=Excel 2002Excel 2002/option
   option label=Excel 2003Excel 2003/option
   option label=Excel 2007Excel 2007/option
 /optgroup
 optgroup label=Word
   option label=Word 2000Word 2000/option
   option label=Word 2002Word 2002/option
   option label=Word 2003Word 2003/option
   option label=Word 2007Word 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.




It might even be useful to allow a value attribute to the optgroup element:
- Optgroup selected, no value attribute provided: Submit array of child 
option values
- Optgroup selected, value attribute provided: Submit value of optgroup 
element


A possible use case for this - the assignment of pictures to a gallery 
page in a CMS:


select name=pix[] multiple
  optgroup label=My family value=family
option value=mom.jpgMom/option
option value=pa.jpgPa/option
  /optgroup
  optgroup label=My pets value=pets
option value=cat.jpgCat/option
option value=dog.jpgDog/option
  /optgroup
/select

Like this you can assign either single pictures or whole categories 
(including future entries to the categories, as you submit the category 
name rather than the contents). Currently the solution for the same task 
looks somehow like this:


select name=pix[] multiple
  option value=familyMy family/option
  option value=mom.jpgnbsp;nbsp;Mom/option
  option value=pa.jpgnbsp;nbsp;Pa/option
  option value=petsMy pets/option
  option value=cat.jpgnbsp;nbsp;Cat/option
  option value=dog.jpgnbsp;nbsp;Dog/option
/select

Which does actually work, but is not structurally nice.


[whatwg] optgroup element used for selection

2009-04-09 Thread Randy Drielinger
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 2000Excel 2000/option
   option label=Excel 2002Excel 2002/option
   option label=Excel 2003Excel 2003/option
   option label=Excel 2007Excel 2007/option
 /optgroup
 optgroup label=Word
   option label=Word 2000Word 2000/option
   option label=Word 2002Word 2002/option
   option label=Word 2003Word 2003/option
   option label=Word 2007Word 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?