P
Peter Foti
Isofarro said:For accessibility, labels should explicitly map to one input element. But
what to do when a text label pertains to three input fields, for instance
date of birth?
I have an html snippet:
<tr>
<th scope="col">
<label for="dobdd">Date of Birth (dd/mm/yyyy)</label>
</th>
<td>
<input type="text" name="dobdd" id="dobdd" />
<input type="text" name="dobmm" id="dobmm" />
<input type="text" name="dobyyyy" id="dobyyyy" />
</td>
</tr>
Now logically the label maps to all three fields, but the label
specification allows one id in the for attribute. Any suggestions of
clarifying this little oddity?
Perhaps something like this:
<label for="dobdd">Date of Birth (dd/</label><label
for="dobmm">mm/</label><label for="dobyyyy">yyyy)</label>
Regards,
Peter Foti