WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: required or aria required usage

for

From: Mallory
Date: May 7, 2020 3:30AM


At Tenon we wrestled with this for the Tenon UI.

Unfortunately it's become a more popular UI component, a set of checkboxes where at least one must be checked but radios or a select cannot be used because users may check more.

What we ended up with:
- the legend adds either the word "required" (for radios) or "choose at least 1" (for checkboxes
- resultant error messages stuffed inside the legend

"aria-required" on the fieldset probably wouldn't have hurt, but we didn't do that. Maybe there wasn't enough AT support back then?

Also, getting error messages to be both programmatically associated with the group and read out wasn't very doable cross-browser: stuffing error messages inot the legend worked the best, even though semantically we'd have preferred doing it differently.

It's already a bit old but you can see an example demo form here: https://www.tenon-ui.info/forms-full-demo

cheers,
_mallory

On Wed, May 6, 2020, at 5:13 PM, Jared Smith wrote:
> I think <fieldset aria-required="true"> would be best. I'm not sure on
> the support for this yet. Also, the semantics seem a bit off because
> checkboxes inherently mean they can be checked or not, which means
> that they are not required, whereas aria-required on the fieldset
> means that something is required.
>
> Probably best of all is to ensure that this is clear in the text
> instructions, optimally in a fieldset legend, along with good error
> messaging and handling
>
> Jared
> > > > >