1.3.5 Identify Input Purpose
Introduction¶
This document provides information about the related Acquia Optimize checks:
- Autocomplete attribute has valid value.
What¶
The autocomplete attribute on HTML input
, select
, and textarea
elements must have a valid value.
Why¶
When the autocomplete attribute on HTML input
, select
, and textarea
elements have a valid value, forms are easier to use and access. Users can enter data faster and with fewer mistakes, especially for repeated information like names or email addresses. For users who use assistive technologies, a valid autocomplete value helps the technology to understand the form fields correctly. Without valid values, users may become confused, experience delays, or make mistakes when they fill out forms.
This check affects the following users who have:¶
- Cognitive disabilities: Who benefit from clear and consistent form behavior to reduce confusion and errors.
- Motor impairments: Who use assistive tools to navigate and complete forms more efficiently.
Sandra is 38 years old. At the age of 16, her life took an unexpected turn during a sports accident on the basketball court. While attempting a daring dunk, she landed in an awkward manner, resulting in a spinal cord injury. Unfortunately, this event left her paralyzed from the waist down.
"I always use my dictation software whenever I can. It’s just so much easier on me—I don’t have to deal with the pain from moving the mouse around. And those forms that auto-fill your information? Absolute lifesavers. The computer already knows my name and all kinds of other details about me, so why not let it do the work? It makes things so much simpler for me!"
Examples¶
This section provides some examples of the issue.
Example: Valid value for the Autocomplete attribute¶
A login form includes a username field coded as:
<label for="username">Username<input id="username" autocomplete="username"/></label>
In this example “username” is a valid value.
This makes it easy for users to understand the expected input type and to receive relevant autocomplete suggestions.
Example: Invalid value for the Autocomplete attribute¶
A login form includes a username field coded as:
<label for="username">Username<input id="username" autocomplete="badname"/></label>
In this example, autocomplete="badname"
is not a valid value. This prevents users from receiving relevant autocomplete suggestions, which makes it harder to input the correct data efficiently.
How¶
How to fix it.
The Acquia Optimize platform highlights HTML input
, select
, and textarea
elements with an autocomplete attribute value that is invalid.
To fix this:
Replace the invalid value with a valid autocomplete attribute value, such as "username
", "email
", or "off
", as defined by the HTML Living Standard. This ensures proper functionality and provides users with relevant autocomplete suggestions.
Additional resources¶
WCAG success criteria¶
1.3.5 Identify Input Purpose
ACT rules¶
Related accessibility conformance testing rules.
Autocomplete attribute has valid value
Other resources¶
Input purposes for user interface components
HTML specification for Autofill detail tokens,