Using Aria-invalid for Error Indication

Sailesh Panchang

By Sailesh Panchang

January 3, 2014

ErrorAria-invalid=true

Setting aria-invalid to “true” is a quick and easy method for indicating that a field has failed validation. Yet, its usefulness from an accessibility standpoint is limited to a situation where:

  • The identity of the failed field is so obvious visually, and
  • No explicit description of the error is really necessary.

Examples include fields whose label / instructional text expressly indicate:

  • Data format for date, email, phone numbers etc.
  • Minimum – maximum range of expected values

Sometimes the placeholder or default text may also indicate the expected data format before a user attempts to fill in the field (care should be taken to ensure this is accessible).  Depending on the context, the data format or expected range may be obvious or clear by general usage and may not even be stated explicitly in all situations.

  • Aria-invalid may also be set on “required” fields when a user omits to complete the field.

Error Notifications

When a field has aria-invalid set to “true”, VoiceOver in Safari announces “invalid data” when the field gets focus; JAWS and NVDA notify the error as an “invalid entry”. For vision impaired users of ARIA-enabled assistive technologies, these notifications are critical for identifying fields that have failed validation in the above situations.

This ARIA attribute has to be set / turned on programmatically.  It should not be set to “true” before input validation is performed or the form is submitted. Setting aria-invalid to “false” is the same as not placing the attribute for the form control at all. Quite understandably, nothing is conveyed by assistive technology to users in this case.

When it is necessary to identify the field that failed validation along with a clear error description, setting aria-invalid to “true” is redundant and does little from a viewpoint of accessibility compliance. In such a case, conveying that an error has occurred and tying the detailed error message with the relevant field programmatically will meet the requirements of SC 3.3.1 and SC 1.3.1.

When the suggestion for fixing the error is presented to the user (in order to meet SC 3.3.3, Level AA), it might be worded in a manner that describes the error too. Here again, aria-invalid=”true” is superfluous.

In example-1,  aria-invalid is used when the personal identification number (PIN), email address, or start date are not in the expected format. An error message is associated with the field using aria-describedby when there’s no input for the first three fields or the requested start date is in the past.

In example-2, aria-invalid has been used on required fields that have no input.

Reference:

  1. Supported States and Properties: WAI-ARIA 1.1
  2. Aria-required=true: WCAG 2 Compliance versus Best Practice

Sailesh Panchang

Principal Accessibility Consultant, Deque Systems

Sailesh Panchang

Sailesh Panchang

One of Deque’s first employees, Sailesh is experienced in conducting accessibility assessments of Web content and software using combination of automated and manual-testing techniques including code reviews. In addition, he works to enable Deque clients to get started and become effective users of Deque’s tools. Sailesh is very strong in application of accessibility techniques for HTML and WAI-ARIA for complying with Section 508, WCAG and legislation like Air Carrier Access Act (ACAA). Sailesh is an assistive technology user and relies on screen reading software like JAWS, NVDA, VoiceOver and TalkBack.

Recevez les articles de blog directement dans votre boîte mail

Pas de bavardages inutiles, mais des informations concrètes sur l'accessibilité, fournies par des experts qualifiés.

Vous acceptez que Deque , utilise et partage des informations conformément à Dequedéclaration de confidentialité. Vous pouvez modifier votre consentement à tout moment en nous contactant.

En savoir plus sur ce sujet

Trois mises à jour majeures en matière d'accessibilité en Australie, et ce qu'elles impliquent pour votre organisation en 2026

Aparna Pasi
15 mars 2026 Par Aparna Pasi

Examinons les dernières évolutions du cadre réglementaire australien afin de comprendre leurs implications pour les entreprises exerçant leurs activités en Australie, mais aussi pour le reste du monde.

Lire l'article
Image d'une personne devant un ordinateur portable, utilisant la langue des signes. Quatre mots ou expressions apparaissent dans des bulles : « Accessibilité numérique », « WCAG 2.2 AA », « Commission australienne des droits de l'homme » et « Loi sur la discrimination fondée sur le handicap ».

Deuxième jour de l'Axe-con 2026

Logo de Deque
26 février 2026 Par Deque

L'Axe-con 2026 est peut-être terminé, mais l'élan ne cesse de prendre de l'ampleur. Entre les témoignages poignants sur le capacitisme et les réflexions révélatrices sur l'impact de l'IA sur la vitesse d'accessibilité, cet événement a été tout simplement incroyable. Découvrez ici notre compte-rendu de la deuxième journée !

Lire l'article
Deuxième jour de l'Axe-con 2026