Verify error prevention (all)
Description
This rule does not automatically validate anything. It simply reminds you to manually verify that for any submission of information, one of the following error prevention mechanisms is provided: the submission is reversible, input errors are automatically detected with suggestions for correction, or a mechanism is available for the user to review, confirm, and correct information before finalizing the submission.
WCAG 3.3.6 (Error Prevention (All)) requires this at Level AAA for all forms where the user commits to an action resulting in legal, financial, or data-modifying consequences. While WCAG 3.3.4 covers Level AA for financial/legal transactions only, this criterion extends the requirement to every form submission regardless of consequence severity.
Disabilities impacted
- Cognitive – Users with cognitive disabilities may misunderstand form fields, enter incorrect data, or forget what they intended to submit. Without review mechanisms, they cannot catch mistakes before finalization, leading to frustration and potentially irreversible errors.
- Motor control – Users with motor impairments may accidentally submit forms due to tremors, unintended clicks, or difficulty controlling input devices. Without the ability to reverse or review submissions, accidental actions become permanent.
- Visual – Users with low vision or blindness may misread labels, misinterpret field requirements, or enter data into the wrong fields. Automatic error detection and correction suggestions help them identify and fix mistakes they might otherwise miss.
Why it matters
Form errors have real consequences. A mistyped email address on a subscription form, an incorrect shipping address on an order, or a wrong date on a reservation can all lead to wasted time, financial loss, or compromised data integrity. Error prevention mechanisms give users a safety net.
At the AAA level, this criterion ensures that every form, not just those with legal or financial implications, provides adequate error prevention. This is particularly important for users with disabilities who are more likely to make input errors and less likely to notice them without automated assistance or review opportunities. Providing reversibility, input validation, or a confirmation step builds trust and reduces the cognitive burden on all users.
Coding problems and solutions
Common coding problems
- No confirmation step before submission – Forms submit immediately on button click with no opportunity to review entered data, especially dangerous for destructive actions like deletion or account changes.
- Non-reversible submissions – Once submitted, data cannot be undone. There is no “undo” mechanism, grace period, or cancellation option for actions that modify or delete user data.
- No automatic error detection – Forms rely solely on server-side validation with no client-side feedback, meaning users only learn about errors after submission and page reload.
- Error messages without correction guidance – Validation messages state that an error exists but do not suggest how to fix it, leaving users to guess what went wrong.
- Missing input constraints and suggestions – Fields lack format hints, placeholder examples, or input masks that would prevent errors before they occur.
How to fix it
Add a review and confirmation step before submission
Display a summary of all entered data before the user commits to the final submission. This allows review and correction before any irreversible action occurs.
<form id="order-form">
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
<label for="address">Shipping Address</label>
<textarea id="address" name="address" required></textarea>
<button type="button" id="review-btn">Review Order</button>
<div id="review-summary" hidden>
<h3>Please review your order</h3>
<p>Email: <span id="review-email"></span></p>
<p>Address: <span id="review-address"></span></p>
<button type="submit">Confirm and Submit</button>
<button type="button" id="edit-btn">Edit</button>
</div>
</form>
<script>
const reviewBtn = document.getElementById("review-btn");
const editBtn = document.getElementById("edit-btn");
const form = document.getElementById("order-form");
const summary = document.getElementById("review-summary");
reviewBtn.addEventListener("click", () => {
document.getElementById("review-email").textContent =
form.email.value;
document.getElementById("review-address").textContent =
form.address.value;
summary.hidden = false;
reviewBtn.hidden = true;
});
editBtn.addEventListener("click", () => {
summary.hidden = true;
reviewBtn.hidden = false;
});
</script><form id="order-form" action="/submit-order" method="post">
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
<label for="address">Shipping Address</label>
<textarea id="address" name="address" required></textarea>
<button type="submit">Submit Order</button>
</form>Provide reversible actions or an undo mechanism
For actions that delete or modify data, implement an undo feature or a grace period before the action becomes permanent.
const deleteBtn = document.getElementById("delete-account-btn");
let undoTimer = null;
deleteBtn.addEventListener("click", () => {
const confirmation = document.getElementById("undo-banner");
confirmation.hidden = false;
undoTimer = globalThis.setTimeout(() => {
globalThis.fetch("/api/account/delete", { method: "POST" })
.then(() => {
globalThis.location.href = "/account-deleted";
})
.catch((err) => {
console.error("Deletion failed", err);
});
}, 10000);
});
document.getElementById("undo-btn").addEventListener("click", () => {
if (undoTimer !== null) {
globalThis.clearTimeout(undoTimer);
undoTimer = null;
}
document.getElementById("undo-banner").hidden = true;
});document.getElementById("delete-account-btn")
.addEventListener("click", () => {
globalThis.fetch("/api/account/delete", { method: "POST" })
.then(() => {
globalThis.location.href = "/account-deleted";
});
});Detect errors automatically and suggest corrections
Use client-side validation to detect common mistakes and provide specific, actionable error messages with correction suggestions.
<label for="phone">Phone Number</label>
<input type="tel" id="phone" name="phone"
pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}"
placeholder="555-123-4567"
aria-describedby="phone-error">
<span id="phone-error" role="alert" class="error-message"></span>
<script>
const phoneInput = document.getElementById("phone");
const phoneError = document.getElementById("phone-error");
phoneInput.addEventListener("input", () => {
const raw = phoneInput.value.replace(/[^0-9]/g, "");
if (raw.length === 10) {
const formatted = raw.slice(0, 3) + "-" +
raw.slice(3, 6) + "-" + raw.slice(6);
phoneInput.value = formatted;
phoneError.textContent = "";
} else if (phoneInput.value.length > 0 && raw.length !== 10) {
phoneError.textContent =
"Please enter a 10-digit phone number. " +
"Example: 555-123-4567";
}
});
</script><label for="phone">Phone Number</label>
<input type="tel" id="phone" name="phone">
<!-- Error only shown after server-side submission -->
<p class="error-message" hidden>Invalid phone number</p>Use input constraints to prevent errors at the source
Apply HTML5 input types, constraints, and attributes to guide users toward correct input formats before errors can occur.
<label for="quantity">Quantity (1-100)</label>
<input type="number" id="quantity" name="quantity"
min="1" max="100" value="1"
aria-describedby="quantity-hint">
<span id="quantity-hint">Enter a number between 1 and 100</span>
<label for="birthdate">Date of Birth</label>
<input type="date" id="birthdate" name="birthdate"
max="2026-12-31" required><label for="quantity">Quantity</label>
<input type="text" id="quantity" name="quantity">
<label for="birthdate">Date of Birth</label>
<input type="text" id="birthdate" name="birthdate"
placeholder="MM/DD/YYYY">Known Limitations
- Manual-only rule – This rule does not perform any automated element validation. It fires a single global reminder whenever forms or submit buttons are present, relying entirely on developer or tester judgment to verify error prevention mechanisms.
- Single-page applications (SPAs) – Dynamic forms rendered via JavaScript frameworks after the initial page load may not be captured by the selector, as the rule targets elements present at scan time.
- Shadow DOM – Forms or submit buttons encapsulated inside shadow roots are not reachable by standard DOM queries, so the rule will not report on them.
- Iframes – Forms embedded in cross-origin HTML iframes are inaccessible to the auditor due to same-origin policy restrictions. The rule cannot evaluate error prevention for such forms.
- Complex multi-step workflows – Wizard-style or multi-page forms where the “submission” is an intermediate step (not the final commit) may not fit neatly into the reversal/correction/check model, requiring nuanced human judgment.
- Server-side-only validation – If error prevention logic exists entirely on the server (e.g., showing a review page after POST), the auditor has no way to detect it from the initial page state.
Resources
- WCAG 2.2 – Success Criterion 3.3.6: Error Prevention (All)
- W3C Understanding SC 3.3.6: Error Prevention (All)
- MDN – Constraint validation
- WCAG 2.2 – Principle 3: Understandable
Rule
- Audit: accessibility
- Standard: WCAG
- Level: Triple A
- Success Criteria: 3.3.6
- Rule ID:
error-prevention-all-forms