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 
autocompleteattribute is a case-insensitive match for eitheronoroff. - the element is neither visible nor included in the accessibility tree; or
 - the element is an 
<input>element with atypeattribute in theHidden,Button,Submit Button, orReset Buttonstate; or - the element has a 
disabledattribute; or - the element has an 
aria-disabledattribute with a value oftrue; or - the element has a negative 
tabindexattribute, and a semantic role that is not a widget. 
 The specification of the type attribute describes in detail how to map the value of the attribute to its corresponding state.
Expectations
- The value of the attribute is valid according to the specification of 
autocompleteattributes wearing the autofill expectation mantle. As such, the value must consist of either the case-insensitive stringofforon, 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
autocompleteattribute is a promising technique for supporting personalization on the web, support is limited. - 
Most browsers behave the same way whether the
autocompleteattribute 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).