Accessibility - Best usability when label applies to two form elements

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

I have a time select form that is two select option elements, one for the hour and one for the minute (with 15 min granularity).

I only want 1 label saying choose time as I think its obvious its hour and minute. Normally I associate a label with an input like so:

<label for="something">Label Text</label>
<input id="something" /> 

So what should I do in this case where the label relates to two elements?

Thanks

Answers

http://www.w3.org/wiki/HTML/Elements/fieldset http://www.w3.org/wiki/HTML/Elements/fieldset

  Like this:   
<fieldset>
    <legend>Choose Time</legend>
    <label for="hour">Hour</label>
    <input id="hour" />
    <label for="minute">Minute</label>
    <input id="minute" />
</fieldset>

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/12460412/best-usability-when-label-applies-to-two-form-elements

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils