A: Form elements must have labels (WCAG 4.1.2)
label
Ensure that every <form> element has a unique, programmatically determinable label.
This means
The form has no accessible name. Screen readers announce only “form” without purpose or context. Users do not know which form they are opening.
Impact
Orientation suffers, processes are aborted, error rates increase. Risk of WCAG violation and negative effect on conversion.
Recommendation
-
Assign a short, clear form title.
-
Programmatically link:
aria-labelledbyto a visible heading or usearia-labeldirectly on the<form>. -
Make the title visible and keep it unique on the page.
Example
Problematic
<form>
<!-- Fields without form title -->
</form>
Better (link visible heading)
<h2 id="contact-h">Contact Form</h2>
<form aria-labelledby="contact-h">
…
</form>
Alternative (compact with label)
<form aria-label="Newsletter Signup">
…
</form>
Search (additional semantics helpful)
<form role="search" aria-label="Website Search">
…
</form>
Related WCAG criterion:
WCAG 4.1.2 - Name, Role, Value
WCAG 4.1.2 - Name, Role, Value