Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aria-required in a radio group

When I have a mandatory (required) radio group, which element(s) should have the aria-required="true" attribute? Basically, I have a bunch of <input type="radio"> elements that share the same name and are grouped together under a <fieldset>.

  1. Should I put aria-required on the <fieldset>?
  2. Should I put aria-required on each radio?
  3. Or would you say "there should be no such thing as a mandatory radio group; set a default value so that the radio group can never be in non-selected state"? -- perhaps this is the topic for a separate usability discussion.
like image 323
Ates Goral Avatar asked Dec 14 '11 18:12

Ates Goral


People also ask

Is aria-required?

The aria-required attribute indicates that user input is required on the element before a form may be submitted.

What is the difference between required and aria-required?

It can be added to form fields just like aria-required=”true” and it's supposed to alert screen reader users that the field is required. However, where HTML 5 required differs from aria-required=”true” is that HTML 5 required actually has behavior associated with it.

What does aria-required true do?

The WAI-ARIA aria-required property indicates that user input is required before submission. The aria-required property can have values of "true" or "false". For example, if a user must fill in an address field, then aria-required is set to "true".

How do I use the aria selection?

In a tablist, aria-selected is used on a tab to indicate the currently-displayed tabpanel . The selected tab in a tablist should have has its aria-selected="true" set. All inactive tabs in the tablist should have aria-selected="false" set.


1 Answers

As a screen reader user I would suggest option one or three. I don’t want to hear my screen reader announce “required” every time I change the selection on a radio button. If I’m going through the effort to view the different options having “required” announced on each one will get repetitive quickly. I’d like to have the required attribute on the fieldset element so I know it’s a section of the form that does need to be filled out.

From a usability perspective I prefer to have a default selection since if I see a default I usually skip to the next section of the form assuming the default isn’t obviously wrong. Whether you feel comfortable with providing the user a default choice and not forcing them to make a selection would depend on the importance of the information your application requires and the consequences if that information is wrong.

like image 172
Jared Avatar answered Sep 30 '22 09:09

Jared