id | name | rule_type | description | accessibility_requirements | input_aspects | acknowledgments | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e086e5 |
Form control has non-empty accessible name |
atomic |
This rule checks that each form field element has a non-empty accessible name.
|
|
|
|
This rule applies to any element that is included in the accessibility tree, and that has one of the following semantic roles: checkbox
, combobox
(select
elements), listbox
, menuitemcheckbox
, menuitemradio
, radio
, searchbox
, slider
, spinbutton
, switch
, textbox
.
Note: The list of roles is derived by taking all the roles from WAI-ARIA Specifications that:
- have a semantic roles that inherits from the abstract
input
orselect
role, and - does not have a required context role that itself inherits from one of those roles.
Note: The option
role is not part of the list of applicable roles, because it does not meet the definition of a User interface component. This means WCAG 2.1 does not require it to have an accessible name.
Each target element has an accessible name that is not empty (""
).
There are currently no assumptions
- Certain assistive technologies can be set up to ignore the title attribute, which means that to some users the title attribute will not act as an accessible name.
- Several assistive technologies have a functionality to list all form fields on a page, including the
disabled
ones. Therefore this rule is still applicable todisabled
form fields. If an assistive technology consistently ignoresdisabled
form fields in all its interactions, then it is possible to have adisabled
form field with no accessible name without creating accessibility issues for the user. - Implementation of Presentational Roles Conflict Resolution varies from one browser or assistive technology to another. Depending on this, some elements can have one of the applicable semantic roles and fail this rule with some technology but users of other technologies would not experience any accessibility issue.
- Understanding Success Criterion 3.3.2: Labels or Instructions
- Understanding Success Criterion 4.1.2: Name, Role, Value
Note: This rule does not fail 3.3.2 as there are sufficient techniques within 3.3.2 that don't need the elements to have an accessible name. For example "G131: Providing descriptive labels" AND "G162: Positioning labels to maximize predictability of relationships" would be sufficient.
Implicit role with implicit label.
<label>
first name
<input />
</label>
Implicit role with aria-label
<input aria-label="last name" disabled />
Implicit role with explicit label
<label for="country">Country</label>
<select id="country">
<option></option>
</select>
Implicit role with aria-labelledby
.
<div id="country">Country</div>
<textarea aria-labelledby="country"></textarea>
<div aria-label="country" role="combobox" aria-disabled="true">England</div>
The accessible name is not only whitespace.
<label>
:-)
<input />
</label>
No accessible name.
<input />
Non-focusable element still needs an accessible name.
<input tabindex="-1" />
aria-label
with empty text string
<div aria-label=" " role="combobox">England</div>
aria-labelledby
with empty text string.
<div id="country"></div>
<div aria-labelledby="country" role="combobox">England</div>
The implicit label is not supported on div
elements.
<label>
first name
<div role="textbox"></div>
</label>
The explicit label is not supported on div
elements.
<label for="lastname">first name</label>
<div role="textbox" id="lastname"></div>
The accessible name is empty.
<label> <input /></label>
This input
element has an explicit role of none
. However, it is focusable (by default). Thus it has a semantic role of textbox
due to Presentational Roles Conflict Resolution. It has an empty accessible name.
<input role="none" />
Hidden to everyone.
<input aria-label="firstname" style="display:none;" />
Hidden to assistive technologies.
<input disabled aria-hidden="true" aria-label="firstname" />
Role has explicitly been set to something that isn't a form field.
<input role="presentation" disabled />
Option inherits from input, but has a required context role of listbox which inherits from select. We should therefore not consider option as applicable.
<select role="none" disabled>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
</select>