WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: ARIA Attributes

for

From: Birkir R. Gunnarsson
Date: Aug 22, 2016 6:21PM


You cannot use aria-labelledby for error messages.
aria-labelledby is used to connect a form field with an element
containing its label (it is always preferable to use the html label
element, either wrapped around the form field and the text or with a
for attribute whose ID matches the ID of the input field).
This gets mapped to the elements accessible name.
It is supposed to be short and descriptive.
<span id="lbl">Please enter your name</label>
<input type="text" aria-labelledby="lbl">

aria-describedby is supposed to be used for instructions of further
information, including (for the moment) error messages.
<span id="lbl">Please enter your name</label>
<span id="instr">Can only contain white space and characters, cannot
exceed 40 characters.</span>
<input type="text" aria-labelledby="lbl" aria-describedby="instr">

You can also provide the accessible description through the title attribute
<input type="text" aria-labelledby="lbl" title="Can only contain white
space and characters must not exceed 40 characters">
(in fact, if there is no other source for the accessible name, the
value of the title attribute, if present, is used).

For error messages you need to use aria-describedby.
If it already has a reference to the instructions, you put the ID of
the error message string before the ID of the instructions.
<span id="lbl">Please enter your name</label>
<span id="instr">Can only contain white space and characters, cannot
exceed 40 characters.</span>
<input type="text" aria-labelledby="lbl" aria-describedby="errMsg, instr">
<span id="errMsg">Error: name must not be empty.</span>


ARIA 1.1 is defining a different way to reference error messages, but
the spec is not finalized yet, and there is little or no support for
it in the user agents.
Cheers
-B







On 8/22/16, Jim Homme < <EMAIL REMOVED> > wrote:
> Hi Jamous,
> I think you can use ID.
>
> Jim
>
>
> =========> Jim Homme,
> Accessibility Consultant,
> Bender HighTest Accessibility Team
> Bender Consulting Services, Inc.,
> 412-787-8567,
> <EMAIL REMOVED>
> http://www.benderconsult.com/our%20services/hightest-accessible-technology-solutions
> E+R=O
>
> -----Original Message-----
> From: WebAIM-Forum [mailto: <EMAIL REMOVED> ] On Behalf
> Of Jamous, JP
> Sent: Monday, August 22, 2016 2:02 PM
> To: WebAIM Discussion List < <EMAIL REMOVED> >
> Subject: Re: [WebAIM] ARIA Attributes
>
> Not considering it as I want to reference error messages through IDs.
>
>
>
>
> **************************************************
>
> Jean-Pierre Jamous
> Digital Accessibility Specialist & Developer UI Accessibility Team
>
> The only limitations in life are those we set for ourselves
>
> **************************************************
>
>
> -----Original Message-----
> From: WebAIM-Forum [mailto: <EMAIL REMOVED> ] On Behalf
> Of Jim Homme
> Sent: Monday, August 22, 2016 12:43 PM
> To: WebAIM Discussion List < <EMAIL REMOVED> >
> Subject: Re: [WebAIM] ARIA Attributes
>
> Hi Jamous,
> Out of curiosity, are you also considering AriaLabel, or have you ruled that
> out for some reason?
>
> Thanks.
>
> Jim
>
>
> =========> Jim Homme,
> Accessibility Consultant,
> Bender HighTest Accessibility Team
> Bender Consulting Services, Inc.,
> 412-787-8567,
> <EMAIL REMOVED>
> http://www.benderconsult.com/our%20services/hightest-accessible-technology-solutions
> E+R=O
>
> -----Original Message-----
> From: WebAIM-Forum [mailto: <EMAIL REMOVED> ] On Behalf
> Of Jamous, JP
> Sent: Monday, August 22, 2016 1:38 PM
> To: WebAIM Discussion List < <EMAIL REMOVED> >
> Subject: [WebAIM] ARIA Attributes
>
> Folks,
>
> Based on experience and not literature , what is best, aria-describedby or
> aria-labelledby?
>
> We know that aria-describedby has issues with JAWS. How about Labelledby?
>
> Just want to hear some feedback from those who has gotten their fair share
> of experience with those 2.
>
> What do you recommend using and why?
>
>
>
>
> **************************************************
>
> Jean-Pierre Jamous
> Digital Accessibility Specialist & Developer UI Accessibility Team
>
> The only limitations in life are those we set for ourselves
>
> **************************************************
>
>
> > > http://webaim.org/discussion/archives
> > > > http://webaim.org/discussion/archives
> > > > http://webaim.org/discussion/archives
> > > > > >


--
Work hard. Have fun. Make history.