Why form accessibility matters
Forms are how people access services: book medical appointments, request records, pay bills, order groceries, and renew prescriptions. When labels are missing, errors are vague, or critical buttons are unreachable via keyboard, people are effectively excluded. Accessibility here is not a visual preference—it’s the difference between getting care, completing a purchase, or being shut out.
Labels: persistent, explicit, and programmatic
Every input needs a label that is both visible and programmatically associated.
Placeholders vanish on focus and are not labels; they harm users with memory, cognitive, or low-vision needs.
Use <label for="id"> with a unique id on the control. For grouped controls (e.g., radio groups), provide a group label with fieldset and legend.
<label for="email">Email</label>
<input id="email" name="email" type="email" autocomplete="email" required>
<fieldset>
<legend>Contact preference</legend>
<label><input type="radio" name="contact_pref" value="call"> Phone call</label>
<label><input type="radio" name="contact_pref" value="email"> Email</label>
</fieldset>
Input types, autocomplete, and mobile ergonomics
Semantic input types and autocomplete tokens improve accuracy, speed, and accessibility. They prompt the right on-screen keyboards, enable browser autofill, and help assistive tech announce expectations.
- Use semantic types:
email,tel,url,number,date,search. - Enable autofill:
autocomplete="name",given-name,family-name,address-line1,address-line2,postal-code,cc-number,cc-exp,cc-csc. - Don’t disable zoom. Users must be able to pinch to zoom; oversized tap targets (≥44px) help accuracy.
Error handling: clear, specific, and announced
Errors should be discoverable non-visually, specific to the field, and reachable by keyboard. Avoid generic messages like “There was an error.” Tell users exactly what to fix and move focus to the first error.
<label for="phone">Phone</label>
<input id="phone" name="phone" type="tel" aria-describedby="phone-hint phone-err">
<div id="phone-hint" class="hint">Format: 555-555-5555</div>
<!-- On validation failure -->
<div id="phone-err" class="error" role="alert">Phone must be 10 digits.</div>
The role="alert" (or a polite aria-live="polite") ensures screen readers announce new errors. Keep error text adjacent to the field and reference it via aria-describedby.
After submission, programmatically move focus to the first field with an error so users don’t hunt around.
Validation: inline and server-side
Client-side checks are helpful but must never be the only validation. Provide:
- Inline validation after blur or on submit, with clear messages.
- Server-side validation with the same accessible messages. Never rely solely on color to indicate errors.
- Graceful patterns: accept common formats (e.g., spaces in credit cards, varied phone formats) and normalize on the server.
Required fields, optional fields, and instructions
State requirements explicitly; do not depend on red asterisks alone. Either mark required fields individually or add “All fields required unless marked optional” and clearly mark optional ones.
Keep instructions near the field they apply to. For complex inputs (tax IDs, insurance numbers), add aria-describedby to link the instruction text.
Multi-step forms and wizards
Checkouts and appointments often span steps. Users need orientation, progress, and persistence:
- Progress indicators: Announce step names and number (e.g., “Step 2 of 4: Shipping”). Use
aria-current="step"on the current step. - Persistent data: Preserve previously entered values when navigating back or on validation errors.
- Logical focus: Move focus to the main heading of the new step after navigation.
<nav aria-label="Checkout progress">
<ol class="steps">
<li aria-current="step">Shipping</li>
<li>Payment</li>
<li>Review</li>
</ol>
</nav>
CAPTCHAs and human verification
Visual puzzles exclude many users. Prefer human verification that doesn’t rely solely on vision: email/SMS verification codes, time-delayed honeypots, or server-side anomaly checks. If a CAPTCHA remains, provide an equally effective non-visual alternative and ensure it’s operable via keyboard and announced to screen readers.
Timing, sessions, and interruptions
People may require extra time to read, magnify, or navigate. If a session times out, provide warnings and a way to extend. On timeouts, preserve entered data so users don’t have to start over. Avoid auto-advancing steps or surprise focus shifts when validation occurs.
Designing complex inputs accessibly
Phone and credit card inputs
- Accept multiple formats; sanitize on submit.
- Consider single text inputs over multi-field split (MM/YY and CVV can remain separate if labeled precisely).
- Expose correct
autocompletetokens (e.g.,cc-number,cc-exp,cc-csc).
Date pickers
- Allow direct text entry with a clear format hint; don’t force a complex calendar widget.
- If a calendar is provided, implement full keyboard navigation and announce month/year changes.
Addresses
- Keep field order predictable (name → address lines → city → state → postal code → country).
- Autocomplete tokens:
address-line1,address-line2,postal-code,country. - Don’t block PO Boxes unless absolutely necessary—and explain why when you do.
Accessible buttons, links, and submit actions
The primary action should be a <button type="submit"> element with a clear label (“Place order,” “Book appointment”).
Avoid image-only buttons; if present, ensure the accessible name reflects the function, not the icon (“Apply coupon,” not “tag icon”).
Announcements and confirmations
When form state changes—items added to cart, saved addresses, discount applied—use concise live regions so screen reader users receive confirmation.
Prefer aria-live="polite" to avoid interrupting current speech, and clear the region before writing new messages to prevent noise.
<div id="status" aria-live="polite"></div>
<script>
function announce(msg){ const s = document.getElementById('status'); s.textContent = ''; requestAnimationFrame(() => s.textContent = msg); }
// announce('Discount applied: SAVE10');
</script>
Color, contrast, and hints
Never depend on color alone to convey state (errors in red only). Include icons or text and ensure sufficient contrast for text, placeholders, and focus indicators. Hint text should remain visible on focus; do not replace labels with hints.
Accessibility checks you can run in 10 minutes
- Keyboard-only: Complete the form without a mouse. Is focus always visible? Can you submit?
- Labels: Do all inputs have visible labels tied with
for/id(orlegendfor groups)? - Errors: Submit blank—are errors specific, adjacent to fields, announced, and focused?
- Autocomplete: Do fields support browser autofill with the right
autocompletetokens? - Timing: If there’s a time limit, can you extend it? Does data persist after timeout?
- CAPTCHA: Is there a non-visual, keyboard-operable alternative?
- Mobile: Can you zoom? Are tap targets generous and labels readable at 200%?
Evidence to capture when a form blocks access
When a form denies equal access, document it so the issue can be verified and addressed:
- Screenshots or short recordings showing the field, the error, and the attempted action.
- Date/time, URL, device and browser, plus any assistive tech used (“NVDA + Firefox,” “VoiceOver on iPhone”).
- Exact steps taken (“Pressed Tab from address; focus skipped ‘Place Order’,” “Submitted; error said ‘Invalid’ with no field indicated”).
- Consequence (missed appointment, abandoned cart, lost discount, delayed service).
Why this is also good business
Accessible forms convert better. Clear labels and forgiving validation reduce abandonment and support requests, while semantic controls and proper tokens speed checkout with autofill. These are usability improvements that benefit every customer.
How The Brensilber Law Firm helps (briefly)
When inaccessible forms block access to services, we help clients turn experience into action—focusing on evidence, impact, and outcomes that lead to meaningful fixes. If you ran into barriers like those described here, contact us to discuss options, or explore our Resource Hub for more guides.