Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Form errors not linked to fields (aria-describedby): how to fix

PRF-309Low impactOther toolBy FunnelGuardPublished Updated
On this page

What this issue is

When a visitor makes a mistake in a form, the page shows a message such as "Enter a valid email". Sighted people see it beside the field. But in the HTML, the message is often just a nearby <div> or <span> with no link to the input.

aria-describedby is an attribute that points an input at another element by its id. A screen reader then reads that element's text after the field's label. Without it, the user tabs into the field and hears only "Email, edit text". The error is somewhere else on the page.

This relates to WCAG 2.2 success criteria 3.3.1 (Error Identification) and 1.3.1 (Info and Relationships). It is about the connection in code. Whether the error is spoken the moment it appears is a separate issue (see aria-live).

Why it costs you leads or sales

People using screen readers, and some voice and switch users, cannot tell which field failed or why. They may retry the same value, give up, or leave. Each of those is a lost enquiry or order. The business impact is usually low in volume terms, but those visitors are completely blocked, and accessibility complaints are a legal and reputational risk in some markets.

Where the visitor gets stuck
  1. Fills in formTypes an invalid email
  2. SubmitsValidation fails, message appears
  3. Error not linkedField read without its error
  4. Corrects fieldUser does not know what is wrong
  5. Lead sentForm is abandoned

The error is shown on screen but not tied to the field, so a screen reader user never learns what to fix.

How to check if your site has it

Manual check in about five minutes
  1. Trigger an error

    Submit your form empty, or with a bad email or phone number, so the error messages appear.

  2. Inspect the input

    Right-click the field, choose Inspect, and look for aria-describedby on the input. Check that the id it names exists on the error element.

  3. Check aria-invalid

    A field that failed validation should have aria-invalid="true".

  4. Listen with a screen reader

    Tab into the failed field using NVDA (Windows, free), VoiceOver (Mac/iOS) or TalkBack (Android). You should hear the label, then the error text.

  5. Run an accessibility scanner

    Browser tools such as axe DevTools or Lighthouse can flag broken aria references, though they cannot judge whether your error text is useful.

How to fix it

The pattern is the same everywhere: the error element gets a unique id, the input points to it, and aria-invalid is set only while the field is wrong.

Error markup

Not linked

  • Error is a loose span after the input
  • Input has no aria-describedby
  • No aria-invalid on the field
  • Screen reader says only 'Email, edit text'

Linked

  • Error has a unique id
  • Input has aria-describedby pointing to it
  • aria-invalid="true" while invalid
  • Screen reader says 'Email, invalid entry, Enter a valid email address'
Linked error messagehtml
<label for="email">Email</label>
<input type="email" id="email" name="email"
       aria-invalid="true"
       aria-describedby="email-error">
<p id="email-error">Enter an email address like name@example.com</p>

If the field also has hint text, list both ids separated by a space: aria-describedby="email-hint email-error".

Add and remove the link when validatingjavascript
function showError(input, message) {
  const id = input.id + '-error';
  let err = document.getElementById(id);
  if (!err) {
    err = document.createElement('p');
    err.id = id;
    input.insertAdjacentElement('afterend', err);
  }
  err.textContent = message;
  input.setAttribute('aria-invalid', 'true');
  input.setAttribute('aria-describedby', id);
}

function clearError(input) {
  const err = document.getElementById(input.id + '-error');
  if (err) err.remove();
  input.removeAttribute('aria-invalid');
  input.removeAttribute('aria-describedby');
}
Fix by platform
  1. Check your form plugin

    Many form plugins (for example Gravity Forms, WPForms, Contact Form 7) add aria-describedby to errors. Update the plugin and test. Look for an accessibility or 'enable ARIA' option in its settings.

  2. Check the theme

    If the theme restyles or replaces validation messages, override its template or script so the error keeps its id and the input keeps aria-describedby.

How to confirm it's fixed

Confirmation checklist
  • Each invalid field has aria-describedby pointing to an id that exists once on the page
  • aria-invalid="true" appears only on fields that are wrong
  • A screen reader reads the label, then the error text, when you tab into a failed field
  • The link and aria-invalid are removed once the value is corrected
  • Hint text and error text are both read when both ids are listed
  • A scanner such as axe reports no broken aria-describedby references

How to prevent it happening again

Put the pattern in one reusable form component or template so every new form gets it. Add a screen reader pass and an automated accessibility scan to your release checklist, and re-test after form plugin, theme or page builder updates, which often rewrite error markup.

How FunnelGuard handles this

This issue is outside what FunnelGuard checks. FunnelGuard is a synthetic monitoring service: a robot visitor runs your real journeys on a schedule and checks steps, tracking hits and whether test leads arrive. It does not inspect ARIA attributes or how a screen reader reads your form.

The kind of tool that fits is an accessibility testing tool: an automated scanner such as axe DevTools or Lighthouse for quick checks, plus manual testing with a screen reader like NVDA or VoiceOver. FunnelGuard can still help with a related problem: if a form stops submitting or test leads stop arriving, its scheduled journey check will show that.

Questions people ask

What is aria-describedby on a form field?

aria-describedby is an HTML attribute that points an element to another element's id, so assistive technology reads that element's text as extra description. On a form input it is commonly used to attach hint or error text, so a screen reader announces it after the field's label.

Why does my screen reader not read the form error message?

Most often the error is a separate element near the input with no programmatic link to it. Give the message an id, add aria-describedby with that id to the input, and set aria-invalid="true" so the error is read when the user reaches the field.

Should I use aria-describedby or aria-errormessage for errors?

aria-describedby has the most reliable support across browsers and screen readers, so it is the safer choice today. aria-errormessage is designed for errors and works with aria-invalid, but support has been less consistent, so test before relying on it.

Do I need aria-invalid as well?

Yes, it is good practice. aria-invalid="true" tells assistive technology the current value is not accepted, and many screen readers announce 'invalid entry'. Remove it when the field becomes valid.

Can I put the error text inside the label instead?

You can, but it makes the label change and be read every time, which is noisy. A separate error element linked with aria-describedby keeps the label stable and lets you add or remove the message cleanly.

Does this affect SEO or conversions?

It does not affect search rankings directly. It affects conversions for visitors who use screen readers or other assistive tools, because they cannot tell what to correct and may abandon the form.

How do I test linked form errors without special software?

Inspect the input in your browser's developer tools and confirm aria-describedby matches an existing error element id. For a real check, use a free screen reader such as NVDA on Windows or VoiceOver on Mac and tab through a failing form.

Can FunnelGuard check if my form errors are linked to fields?

No. FunnelGuard monitors whether your funnel steps, tracking and test leads work, not ARIA markup. Use an accessibility scanner like axe or Lighthouse together with manual screen reader testing for this.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.