SiteLint documentation and guidelines

Verify error prevention

Description

This rule does not automatically validate anything. It simply reminds you to manually verify that critical transactions – such as legal commitments, financial payments, data submissions, or actions that permanently modify or erase stored data – include mechanisms to prevent, correct, or reverse errors before they cause irreversible harm. It is a pure WCAG 3.3.4 review reminder, targeting forms that involve payment, submission, or confirmation steps.

Error prevention matters because a single mis-click on a checkout or delete form can cost money, time, an account, or irreplaceable data. Users – especially those with cognitive or motor disabilities – are far more prone to accidental input. The rule prompts you to confirm that your critical forms provide reversible or confirmed actions.

Disabilities impacted

  • Cognitive disabilities – Users with memory or attention impairments may misread options or tap the wrong control. Without confirmation and reversal, one error can permanently lock them out, delete their work, or charge them incorrectly.
  • Motor disabilities – Users relying on switch access, voice control, or eye tracking frequently trigger unintended clicks while navigating. Reversible and confirmed actions let them recover without losing data.
  • Visual disabilities – Screen reader users may activate a submit button before hearing the full context of a form summary. A confirmation step or editable summary reduces the cost of premature submission.

Why it matters

Beyond compliance, error prevention builds user trust and reduces support burden. When users can reverse a mistaken payment, restore deleted content, or correct a mis-submitted form, they are less likely to abandon the site in frustration. This aligns with ADA, EAA, and Section 508 expectations that interfaces be usable by everyone, regardless of ability.

Coding problems and solutions

Common coding problems

  • No confirmation step – Submitting a payment or deleting data happens instantly with no review or confirm dialog.
  • No way to reverse – Destructive actions lack undo, cancel, or recovery mechanisms.
  • No editable summary – Users cannot review what they entered before final submission, forcing errors to go through.
  • Confirmation is not accessible – Confirm dialogs depend on mouse-only interactions or fail to move keyboard focus, trapping motor and screen reader users.
  • Assumed device memory – Relying on browser back buttons or session state to restore data that is never actually persisted.

How to fix it

Provide a confirmation step

Correct example
<form action="/payment">
  <label for="amount">Amount</label>
  <input id="amount" name="amount" type="number" required>
  <button type="submit">Review payment</button>
  <output id="summary" aria-live="polite">
    <p>You are about to pay <strong>$99.00</strong>.</p>
    <button type="submit" formnovalidate>Confirm payment</button>
    <button type="button">Edit details</button>
  </output>
</form>
Incorrect example
<form action="/payment">
  <label for="amount">Amount</label>
  <input id="amount" name="amount" type="number" required>
  <button type="submit">Pay now</button>
</form>

Make destructive actions reversible

Correct example
<button type="button" id="delete-item">Delete item</button>
<div id="undo-banner" role="status" aria-live="polite" hidden>
  <p>Item deleted. <button type="button" id="undo-btn">Undo</button></p>
  <span class="visually-hidden">Undo available for 30 seconds</span>
</div>
<script>
  const undoBanner = document.getElementById('undo-banner');
  const undoBtn = document.getElementById('undo-btn');
  deleteItem.addEventListener('click', () => {
    undoBanner.hidden = false;
    const timer = globalThis.setTimeout(() => {
      undoBanner.hidden = true;
    }, 30000);
    undoBtn.addEventListener('click', () => {
      globalThis.clearTimeout(timer);
      undoBanner.hidden = true;
    }, { once: true });
  });
</script>
Incorrect example
<button type="button" onclick="deleteRecord()">Delete item</button>
<script>
  function deleteRecord() {
    database.remove(currentId);
  }
</script>

Allow review of an editable summary

Correct example
<form action="/submit">
  <label for="email">Email</label>
  <input id="email" name="email" type="email" required>
  <button type="submit">Review</button>
  <details>
    <summary>Confirm your details</summary>
    <p>Email: <a href="#email">john@example.com (edit)</a></p>
    <button type="submit">Submit final</button>
  </details>
</form>
Incorrect example
<form action="/submit">
  <label for="email">Email</label>
  <input id="email" name="email" type="email" required>
  <button type="submit">Submit</button>
</form>

Keep confirm handling accessible

Correct example
<dialog id="confirm-dialog">
  <h2>Confirm deletion</h2>
  <p>This will permanently remove your account.</p>
  <form method="dialog">
    <button value="cancel">Cancel</button>
    <button value="confirm" autofocus>Delete</button>
  </form>
</dialog>
<script>
  globalThis.confirmDialog.showModal();
</script>
Incorrect example
<div id="confirm-popup" style="display:none">
  <p>Are you sure?</p>
  <button onclick="hidePopup(); deleteRecord();">Yes</button>
</div>

Known Limitations

  • Manual only – Because this rule performs no automated element validation, it cannot catch missing confirmation steps on its own; it depends entirely on developer or tester judgment.
  • Single Page Applications (SPAs) – Logic that commits data may live in JavaScript routers or stores rather than in HTML forms, so the rule’s form selector may not represent the actual risk surface.
  • Shadow DOM – Critical controls inside shadow roots are not matched by the page-level selector and require separate manual review.
  • Iframes – Forms embedded in cross-origin iframes (for example, third-party payment widgets) sit outside the audited document and must be reviewed in their own context.
  • Dynamic selectors – The heuristic selector relies on keywords such as payment or submit; forms that use neutral or arbitrary action URLs may be missed.

Resources

Rule

  • Audit: accessibility
  • Standard: WCAG
  • Level: AA
  • Success Criteria: 3.3.4
  • Rule ID: error_prevention