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
- A modal passed design and QA review, but keyboard users report they can tab out of it into the page behind, and once they do they cannot get back or close it. Diagnose it and tell me what a correct dialog does.hardAlso on accessibility and wcag4 min
- Design rejected the native control, so you are building a custom one. How do you make it accessible?hardAlso on accessibility and wcag5 min
- How do you implement a scalable architecture and tooling to automatically enforce strict WCAG 2.1 AA compliance across dozens of autonomous frontend teams without crippling developer velocity?hardAlso on accessibility and wcag3 min
- Your endpoint takes a typed request body and it still crashed on a missing field. How is that possible when it compiled?mediumAlso on validation4 min