This check aims to ensure that users receive appropriate suggestions so that they can correct form input errors.
When a user submits a form with errors, the error messages must describe the issue and provide clear suggestions on how to fix it.
For example, instead of informing Invalid password, provide a more helpful message such as: The password must be at least 8 characters long and include a number.
Provide specific guidance so that users can quickly understand what went wrong and how to correct it.
Users need a way to identify errors and get the information about how to fix them with minimal effort.
This check primarily affects:
Provide clear and actionable suggestions to improve usability and accessibility for all users.
This section provides some pass and fail examples of this issue.
The error message identifies the problem and offers a solution
<label for="email">Email Address:</label>
<input type="email" id="email" name="email" required>
<span id="email-error" style="color: red;">Please enter a valid email address in the format: [email protected].</span>
Why this works:
The error message explains the issue and the solution.
Use aria-describedby
for accessible error messages
<label for="phone">Phone Number:</label>
<input type="text" id="phone" name="phone" aria-describedby="phone-error">
<span id="phone-error" style="color: red;">Phone number must be in the format (123) 456-7890.</span>
Why this works:
The error message is linked to the input field so that assistive technologies can read it.
Vague error message
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
<span style="color: red;">Invalid input.</span>
Issue:
Fix: Give an informative error message such as:
Error message is only conveyed visually, for example a red border around the field.
<label for="password">Password:</label>
<input type="password" id="password" name="password" required style="border: 2px solid red;">
Issue:
Issue:
Fix: Add a text-based error message such as:
This section provides instructions on how to review and fix the issue.
This section provides some methods on how to review the issue.
Test the form submission
Submit the form with incorrect or missing data and evaluate the response.
Ensure that error messages explain the issue and also suggest a fix
Ensure that each input error message provides clear guidance.
Use a screen reader
Ensure that screen readers announce error messages properly when errors occur.
Ensure that error messages are visible and easy to understand
Error messages cannot be hidden or rely only on color cues.
This section provides some methods on how to correct the issue.
Provide specific suggestions for error correction
<label for="card">Credit Card Number:</label>
<input type="text" id="card" name="card" required aria-describedby="card-error">
<span id="card-error" style="color: red;">Please enter a 16-digit credit card number without spaces.</span>
Why this works: The message clearly explains the correct input format.
Use aria-live for real-time error updates
<div role="alert" aria-live="assertive" id="form-error">
Error: Please enter a valid email address.
</div>
Why this works: The error is read aloud immediately when it appears.
Ensure that errors are not only conveyed visually
Do not just change an input field’s border to red, but also add a text message to explain the error.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
Tue Mar 18 2025 15:03:30 GMT+0000 (Coordinated Universal Time)