Disclosure and dialogs
Accessible confirmation dialogs: Examples and Testing
Published by whatisADA / Grow Wild Agency · Updated
What to build
Use an alert dialog for a brief, important interruption that requires a response, such as confirming a consequential deletion. Describe the consequence clearly and make the safe path easy to identify and operate.
A practical example
Deleting a saved test record opens “Delete this test record?” with a concise statement of what will be removed. Initial focus goes to Cancel when that is the appropriate least-destructive action.
Try the example
Use Tab and your keyboard controls, then compare the behavior with the checks below. This is an isolated learning example; test the complete pattern in your own product and assistive technology setup.
How to check it
- Trigger the confirmation and check that its title, message and actions are announced meaningfully.
- Verify focus containment, Escape/cancel behavior and clear action labels.
- Confirm or cancel, then check the actual result and the logical destination for focus.
What can be missed
A generic “Are you sure?” message may leave the user unable to review the consequence. Use this interruption only when it helps prevent an actual error.
Markup and state contract
This concise markup illustrates names, relationships or state. Custom controls also need the keyboard interaction and state updates described in the checks and primary source; this snippet is not a complete component.
<dialog role="alertdialog" aria-labelledby="delete-title" aria-describedby="delete-detail">
<h2 id="delete-title">Delete this test record?</h2>
<p id="delete-detail">This removes the saved record from this browser.</p>
<form method="dialog">
<button value="cancel">Cancel</button>
<button value="delete">Delete record</button>
</form>
</dialog>Record your test
Use this worksheet to record what you actually checked. Notes stay on this device when you choose Save; they are not sent to us. Avoid personal or confidential information on shared devices.
These are your observations, not automated results or a conformance certificate. A complete evaluation needs appropriate scope, supported technologies, all applicable criteria and relevant page states.
Primary sources and scope
This is independent implementation guidance with original examples. The linked standard contains the full definitions, exceptions and conformance requirements. A criterion or checklist alone does not establish legal applicability or whole-site conformance.