SIA-R10autocomplete
attributes have a valid value
Accessibility requirements
This rule tests conformance of the following accessibility requirements:
Description
This rule checks that autocomplete
attributes have a valid value.
Applicability
This rule applies to every autocomplete
attribute with a non-empty value, specified on an <input>
, <select>
, or <textarea>
element in the HTML namespace, except when
- the
autocomplete
attribute is a case-insensitive match for eitheron
oroff
. - the element is neither visible nor included in the accessibility tree; or
- the element is an
<input>
element with atype
attribute in theHidden
,Button
,Submit Button
, orReset Button
state; or - the element has a
disabled
attribute; or - the element has an
aria-disabled
attribute with a value oftrue
; or - the element has a negative
tabindex
attribute, and a semantic role that is not a widget.
Expectations
- The value of the attribute is valid according to the specification of
autocomplete
attributes wearing the autofill expectation mantle. As such, the value must consist of either the case-insensitive stringoff
oron
, or a list of autofill detail tokens with an autofill field.
Assumptions
This rule makes no assumptions.
Accessibility support
This rule has the following accessibility support concern:
-
While the
autocomplete
attribute is a promising technique for supporting personalization on the web, support is limited. -
Most browsers behave the same way whether the
autocomplete
attribute is appropriate for its control or not. Therefore, this rule doesn't check it.
Examples
Passed
These these elements have a valid autocomplete
attribute and therefore pass the rule:
<input autocomplete="username" />
<textarea autocomplete="section-primary shipping work email"></textarea>
<select autocomplete="bday-month">
<option>January</option>
<option>...</option>
</select>
Failed
These elements have either an unknown autocomplete
value, or the terms form an invalid combination, and therefore fail the rule:
<input autocomplete="badterm" />
<input autocomplete="work photo" />
<input autocomplete="work shipping email" />
Inapplicable
These elements are not visible and are therefore inapplicable:
<input autocomplete="username" style="display:none" />
<input type="hidden" autocomplete="username" />
These elements are disabled and are therefore inapplicable:
<input autocomplete="username" disabled />
<input autocomplete="username" aria-disabled="true" />
Acknowledgments
This document includes material copied from or derived from https://www.w3.org/WAI/standards-guidelines/act/rules/73f2c2/. Copyright © 2024 W3C® (MIT, ERCIM, Keio, Beihang).