autocomplete attribute must be used correctly

Rule ID: autocomplete-valid
Ruleset: axe-core 4.12
User Impact: Serious
Guidelines: WCAG 2.1 (AA), WCAG 2.2 (AA), EN 301 549, RGAA

Start building more accessible experiences

Axe DevTools Pro helps development teams find and fix up to 80% of accessibility issues while coding. No experience required. Get started with your free trial today.

Compliance Data & Impact

User Impact

Disabilities Affected

  • Attention Deficit
  • Blind
  • Low Vision
  • Deafblind
  • Mobility
  • Cognitive

Standard(s)

  • WCAG 2.1 (AA)
  • WCAG 2.2 (AA)
  • EN 301 549
  • RGAA

WCAG Success Criteria [WCAG 2.1 (AA)]

  • 1.3.5: MUST: Identify Input Purpose

WCAG Success Criteria [WCAG 2.2 (AA)]

  • 1.3.5: MUST: Identify Input Purpose

    RGAA

    • 11.13.1: MUST: An input field's purpose can be determined to support autofill with the user's data.

    How to Fix the Problem

    Review the autocomplete value and replace it with a valid one (or remove the attribute if it isn't needed). A value is one or more space-separated tokens in a set order — an optional section name, an optional shipping/billing group, and a recognized field name such as name, email, or tel.

    Good Example

    <input name="email" autocomplete="email">

    Bad Example

    A misspelled or unrecognized token fails the rule, even though an autocomplete attribute is present.

    <input name="email" autocomplete="e-mail">

    See the list of allowed field names in the HTML specification: Determine a field's category.

    Why it Matters

    When a form field has an autocomplete attribute, browsers use it to autofill the field and assistive technologies can use it to describe the field's purpose. An incorrect or misspelled autocomplete value prevents this, so users who rely on autofill or on their assistive technology's understanding of the field lose that help.

    Rule Description

    This rule checks that any autocomplete attribute on a form field has a valid, correctly formatted value. It applies only to fields that already have a non-empty autocomplete attribute — it does not flag fields that are missing the attribute. When the attribute is present, its value must be valid so that browsers and assistive technologies can correctly identify the purpose of the field.

    The Algorithm (in simple terms)

    Finds all form fields (input, select, and textarea elements) that can accept user data and have a non-empty autocomplete attribute, then checks that the attribute's value is valid and correctly formatted. Fields that are hidden, disabled, or read-only are not checked.

    Resources

    Refer to the complete list of axe 4.12 rules.

    Was this information helpful?

    You have already given your feedback, thank you..

    Your response was as follows:

    Was this information helpful?
    Date/Time feedback was submitted: