Making website form errors accessible
Help visitors find and correct form errors using clear text and accessible controls.
Prevent avoidable errors
Give each input a visible, associated label and explain required information before submission. For example, if an enquiry form needs a telephone number only for a requested callback, say so rather than relying on a placeholder that disappears while typing.
Explain the correction
Identify the field and describe the problem in text; colour alone should not carry the message. Associate relevant instructions and error text with the field so assistive technologies can present them, following the W3C guidance.
Keep the visitor’s work
Where practical, retain valid entries when an error is returned and offer a clear route to the affected field. Distinguish a missing answer from a service failure: the latter may require retrying later or using another contact route.
Test the complete journey
Use fictional input to test an empty required field, an invalid format and a failed submission. Check keyboard focus, screen-reader announcements and a narrow screen, and use mocked delivery so no real enquiry is sent. Accessible client-side checks do not replace server-side validation.