How to fix "Form elements must have labels"
When focus lands on a form field, a screen reader announces its label. Without one the visitor hears "edit text" and has to guess. This fails WCAG 1.3.1, 3.3.2 and 4.1.2, and it matters most where it hurts most: checkout, sign-up and contact forms.
The reliable fix: a real label tied to the field
<label for="email">Email address</label>
<input id="email" type="email" name="email" autocomplete="email">
The label's for must equal the field's id exactly. Clicking the label then focuses the field, which also gives touch users a bigger target.
When the design has no visible label
<input type="search" name="q" aria-label="Search products">
<select name="country" aria-label="Country">...</select>
Why a placeholder is not enough
Placeholder text disappears as soon as someone types, usually has too little contrast, and is not announced consistently. Automated checkers accept it as a last resort, which is why many forms pass a scan and still confuse people. Use a label and keep the placeholder for an example value.
A bug worth checking for
We found this in the password page of a widely used Shopify theme: the label's for was set to translated text instead of the field's id, so the label and the field were not connected at all.
<input type="password" id="Password" ...>
<label for="{{ 'general.password_page.login_form_password_label' | t }}">...</label>
The fix is for="Password". Search your templates for for="{{ to find the same mistake.
Check your own site
Our free scanner loads your pages in a real browser and lists every failure like this one that automated testing can detect. Scan a site.