Skip to content
Preptima
mediumConceptCodingScenarioEntryMidSenior

This form marks invalid fields with red text and a red border. What has to change?

Accessible form errors need visible text, programmatic association with the field using aria-describedby, aria-invalid for state and deliberate focus handling after submit. Use this accessibility answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects FORMS to the point an interviewer is testing.

4 min readUpdated 2026-08-15

Answer

Short answer

Do not rely on red text alone. Give each invalid field a text message, connect it to the input with aria-describedby, set aria-invalid when the value is wrong, and move focus to an error summary or the first invalid field on submit.

Was this answer helpful?

Likely follow-ups

  • Native constraint validation gives you error bubbles for free. Why do teams switch them off with novalidate?
  • Where should the error message go visually, above or below the field, and what does that have to do with zoom?
  • A field becomes invalid while the user is still typing in it. When do you announce that, and how do you avoid interrupting them?
  • How would you handle a server-side error that applies to the whole form rather than to one field?

Related questions

Further reading