Table of Contents
Failed submissions can leave customers unsure what went wrong or where to fix it. Accessible form validation makes errors clear in text, connects each message to its field, and guides users back to the problem without erasing their answers.
This guide is for a small-business site owner working with a developer on a contact or checkout form. You can specify and test the experience yourself; the developer needs to implement the field checks, error handling, and server-side safeguards.
Accessible Form Validation Starts With Clear Rules
Tell people what a field needs before they submit it. A label such as “Phone number” identifies the field, but it doesn’t say whether the number is required or which format the site accepts. If a format matters, put a short instruction beside the field, such as “Include the area code.”
Mark required fields in text and explain any symbols. An asterisk alone is easy to miss, especially if its meaning appears only at the top of a long form. For a short form, adding “(required)” to each required label is straightforward. If most fields are required, you can instead identify the optional ones, provided the pattern is consistent.
Keep the rules practical. A contact form should not reject a phone number simply because someone used spaces instead of hyphens. Ask the developer which formats the site accepts and have the server normalize reasonable variations where appropriate. For email addresses, avoid claiming a format is invalid based on an unnecessarily narrow rule.
Instructions should remain visible after an error. Placeholder text disappears when someone types and often has limited contrast, so it is a poor substitute for a label or format guidance. Put those details in visible text associated with the input instead.
Error Messages Should Explain the Fix
A useful error identifies the problem and tells the person what to do next. “Invalid input” gives little help. “Enter an email address in the format name@example.com” gives the user a specific correction without pretending to know which part they mistyped.
Place the message close to its field and make it available to screen readers. Color or an icon can reinforce an error, but neither should be the only signal. Someone who cannot distinguish red from green, or who does not see the screen, still needs the same information in text.
For a form with several errors, add a brief summary near the top after submission. Each summary item should link to the relevant field. Keep the individual messages beside the fields too: the summary helps people find problems, while the local message remains available as they make corrections.
Use a neutral tone. “Enter your ZIP code” is more helpful than “You forgot your ZIP code.” For sensitive fields, avoid repeating private information in an error summary. A checkout form can say “Check your card number” without displaying the number again.
The messages must match the actual rules. If the site accepts international addresses, don’t instruct everyone to enter a five-digit ZIP code. Have the person responsible for the form review the wording alongside the developer who implements the checks.
Field Markup Connects Labels and Errors
A developer can use HTML attributes to connect a visible label, an instruction, and an error to the same input. The following example shows a field after an unsuccessful submission. It illustrates the relationship between the pieces; it does not perform validation by itself.
<label for="email">Email address (required)</label>
<p id="email-hint">Use an address you can check.</p>
<input id="email" name="email" type="email"
required aria-invalid="true"
aria-describedby="email-hint email-error">
<p id="email-error">Enter an email address, such as name@example.com.</p>
<button type="submit">Send request</button>The label’s for value matches the input’s id. The aria-describedby attribute points to both the hint and the error, so assistive technology can associate that text with the field. The developer should set aria-invalid="true" only when the field has actually failed validation, then clear it when the error is resolved.
This is a fragment, not a complete form. The developer must also decide when errors appear, preserve submitted values, and check the data on the server. Built-in browser validation can be useful, but its messages and behavior vary by browser. If the team chooses custom messages instead, ask the developer to ensure those messages are displayed and announced reliably rather than assuming the attributes alone will do it.
For a WordPress form, check the plugin’s documentation and settings for field labels, required fields, custom error messages, and error-summary behavior. Common form plugins include Gravity Forms and WPForms, but features and settings can change. Test the actual form and theme combination instead of assuming a plugin choice makes every form accessible.
Submission Errors Need a Clear Return Path
After a failed submission, users need to know that the form did not go through and where to go next. On a longer form, ask the developer to move focus to an error summary or another clear error notification. The summary should have a descriptive heading, explain that corrections are needed, and link to each affected field.
For a short form with one error, moving focus directly to the field can be reasonable if the message is available when the field receives focus. Whichever approach the team chooses, test it with a keyboard and a screen reader. Focus should not jump unexpectedly while someone is still typing.
Timing matters. Showing an error before a person has had a chance to complete a field can be distracting. A practical starting point is to validate on submission, then update an existing error as the person corrects it. For a field that needs more complex checking, discuss the timing with the developer and test the result with real input.
Preserve answers after a failed submission wherever it is safe to do so. Requiring someone to retype a long message because an email address was missing adds work and increases the chance they abandon the form. Sensitive information, such as card details, needs separate handling; ask the payment provider and developer what can safely be retained.
Server Checks Protect Against Missed Errors
Checks in the browser give fast feedback, but they are not a substitute for checking submitted data on the server. Browser checks can be bypassed or fail to run. The developer should validate required data and enforce business rules on the server, then return understandable errors that the form can display.
A server error is different from a field error. If the submission cannot be processed because the service is unavailable, don’t tell the user that their email address is wrong. Explain that the request was not sent, preserve what can safely be preserved, and offer a useful next step, such as trying again or using an alternative contact method.
For payment and account forms, avoid exposing internal error details or sensitive data in messages. Ask the developer to log technical details appropriately and show users a plain-language explanation. A form can be easy to correct without revealing information that belongs in a private diagnostic log.
These practices support accessibility, but a code review alone cannot establish that a form meets every requirement. Use the Web Content Accessibility Guidelines (WCAG) as the standard for review, and have an accessibility specialist assess the complete experience when conformance is required.
A Contact Form Test Walkthrough
Imagine a contact form with a required email address and message. Before launch, the site owner can check the experience without reading code. The developer should then investigate any failure and repeat the test after making changes.
- Leave both fields blank and submit. Confirm that the page says the request was not sent and identifies both missing fields.
- Use only the keyboard to reach each error and its field. Check that focus is visible and that any summary links take you to the right input.
- Enter an incomplete email address and a message, then submit. The error should explain what to correct, and the message should still be present.
- Correct the address and submit again. Confirm that the old error no longer appears and that the success message clearly says the request was sent.
- Repeat the failed-submission test with a screen reader. Listen for the field label, instruction, and error, and note anything that is skipped or announced at the wrong time.
Also test a server failure in a safe test environment. Ask the developer to simulate it rather than disrupting the live site. Record the browser, device, assistive technology, and exact steps for each problem so the developer can reproduce it.
A successful message should appear only after the site has received confirmation that the request was accepted. It should not promise a reply time unless the business can support that promise. If the form sends email, arrange a separate test to confirm the intended recipient actually receives it.
Frequently Asked Questions
Test that custom error messages appear and are announced reliably, then repeat keyboard and screen-reader checks with the actual form. Browser validation messages and behavior can vary.
Review the plugin documentation and settings for labels, required fields, custom errors, and summaries, then test the actual form with its theme instead of assuming the plugin makes it accessible.
No. It associates the input with its hint and error text, but it does not perform validation. The developer must implement checks and set aria-invalid only when the field has failed.
Ask the payment provider and developer what information can safely be retained, and avoid repeating card details in error messages or summaries.
Show the success message only after the site confirms the request was accepted. If the form sends email, separately test that the intended recipient receives it.
Final Verdict
Use accessible form validation for any form that asks people to provide information, especially contact and checkout forms where a failed submission has a real cost. Keep simple forms simple: a clear field message may be enough when there is only one error, while longer forms benefit from an error summary. Don’t rely on browser checks or plugin claims alone; have a developer test the full submission and failure paths.
Today, submit your own form with every required field blank and record what a keyboard user encounters.

