WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: "Evil" code (was using title attribute as form field label)

for

From: Sailesh Panchang
Date: Nov 8, 2011 7:39AM


John,
As per current documentation H91 of WCAG2
(http://www.w3.org/TR/WCAG20-TECHS/H91.html)
name is only exposed by label or title attribute.
JAWS 12/13 with FF7: reads aria-labelledby with content of TD and
ignores aria-label
NVDA reads aria-label.
With IE9 results are unsatisfactory
Aria-label text is available only to AT users that support it ... if
it is help text it is not available to all.
In this case maybe plain label association will work fine:
markup 'birthday' and 'dd' as label and associate it with text field for DD
Use one to one association for MM and YYYY fields.
This will work with wider set of browsers and AT.
Alternatively use title attribute where label cannot be used.
Else it may fail SC 4.1.2.
I say use ARIA only where nothing else works.
Sailesh Panchang


On 11/7/11, John Foliot < <EMAIL REMOVED> > wrote:
> As a follow on, the following evil code works just great in Firefox 7
> using JAWS 12 (had to test it before I left the office):
>
> <form action="">
> <table role="presentation">
> <tr>
> <td><span id="bar">Birthday</span></td>
> <td><input type="text" name="day" size="2" aria-labelledby="bar
> day"> / </td>
> <td><input type="text" name="month" size="2" aria-labelledby="bar
> month"> / </td>
> <td><input type="text" name="year" size="4" aria-labelledby="bar
> year"></td>
> </tr>
> <tr>
> <td></td>
> <td><span id="day" aria-label="day as a 2 digit
> value">DD</span></td>
> <td><span id="month" aria-label="month as a 2 digit
> value">MM</span></td>
> <td><span id="year" aria-label="year as a 4 digit
> value">YYYY</span></td>
> </tr>
> </table>
> <input type="submit" value="Go">
> </form>
>
> JF
>