Make every field understandable
Give each input a visible label that explains what information is required. Placeholder text is not a replacement for a label because it disappears when a visitor starts typing and may have low contrast. Associate labels programmatically with their controls so assistive technologies can identify them.
Explain requirements before submission
If a field has a format requirement, explain it before the visitor makes an error. For example, state the accepted date format or password rules near the relevant field. Mark required fields clearly and consistently, and do not make visitors guess which information is optional.
Use appropriate input types
Choose input types that match the expected data, such as email for an email address and tel for a phone number. This can provide useful input behaviour on mobile devices. Use autocomplete tokens when they help browsers fill common personal details accurately.
Write actionable error messages
A useful error explains what went wrong and how to fix it. Instead of saying only Invalid input, say which field needs attention and give an example of the accepted format. Keep the user's existing entries when validation fails so they do not have to start again.
Make errors perceivable
Do not communicate errors through colour alone. Add text, associate error descriptions with the relevant field and expose validation status to assistive technology. For a form with several errors, provide a summary near the beginning and link each summary item to its field.
Support keyboard operation
All fields, buttons and help links should be reachable using a keyboard. Focus indicators must remain visible. After a failed submission, consider moving focus to an error summary or the first invalid field so visitors can find the problem quickly without losing their place.
Test the full journey
Test empty submissions, invalid formats, successful completion and server-side errors. Use keyboard navigation and a screen reader where possible. Check that success messages are announced and that the form does not unexpectedly clear or reload in a way that loses user input.
Conclusion
Accessible forms reduce confusion for everyone. Clear labels, upfront instructions, useful validation and recoverable errors help more visitors complete important tasks.
]]>