How to fix error not associated on Adobe Commerce (Magento)
Add `aria-invalid="true"` and a linked `aria-describedby` error message to every form field that fails validation, so screen reader users are told exactly what went wrong.
Steps for Adobe Commerce (Magento)
- Connect to your server via SSH or use your IDE to navigate to the active theme directory: app/design/frontend/VENDOR/THEME/.
- Locate the relevant form template, e.g. Magento_Customer/templates/form/register.phtml for registration, Magento_Checkout/templates/ for checkout forms, or Magento_Contact/templates/form.phtml for contact.
- In each .phtml template, find the <input> elements and add aria-describedby="FIELDNAME-error" as an attribute, then add a sibling <span id="FIELDNAME-error" class="mage-error" role="alert" style="display:none"></span>.
- Magento uses the mage/validation jQuery widget for client-side validation. In your theme's requirejs-config.js or a custom JS mixin, extend the showLabel and highlight methods of the validation widget to additionally set aria-invalid='true' on the field and show/hide the error span.
- Run bin/magento setup:static-content:deploy and bin/magento cache:flush after changes.
- Test on /checkout, /customer/account/create, and /contact using a screen reader.
What is error not associated?
When a customer fills out a form on your site (checkout, contact, newsletter sign-up) and submits it with a mistake, your site needs to tell them two things: (1) that the field is in an error state, and (2) what the error actually is. Sighted users see this visually — a red border, an error message below the field. But screen reader users rely on invisible HTML attributes called `aria-invalid` and `aria-describedby` to receive the same information. Without these attributes, a screen reader user hits Submit, nothing seems to happen, and they have no idea which field failed or why. WCAG 2.1 Success Criterion 3.3.1 (Error Identification) requires that input errors be identified and described to the user in text.
Roughly 7–8 million people in the US use screen readers, and many more use other assistive technologies. If your checkout or contact form is inaccessible, these customers simply cannot complete a purchase or inquiry — which is lost revenue you may not even know about. Beyond conversions, the ADA and similar laws in many countries treat web accessibility failures as discrimination, creating legal exposure including demand letters and lawsuits that have cost retailers thousands to hundreds of thousands of dollars to resolve. Fixing form error accessibility is also a direct ranking signal for Google's Core Web Vitals and overall page-experience scores, meaning it can influence organic search visibility. This is a quick, targeted fix with an outsized impact on inclusivity, revenue, and legal risk.
See the complete Error not associated guide for every platform and the full background.
Not sure if your Adobe Commerce (Magento) store has this?
Run a free SEOLZ scan — we’ll find error not associated and every other issue across your whole site.
Scan my site free