How to fix missing form labels
If a form field does not have a proper name in the code, a screen-reader user may hear only "edit text" or "blank." A voice-control user may not be able to say the name of the field. A person with low vision may lose the placeholder the moment they start typing. Missing labels are one of the most common problems I see, and they are also one of the most straightforward to fix.
This guide is for site owners and developers. It is general information, not legal advice. The official criteria live in WCAG 2.1.
What a "missing label" actually means
A label is the programmatically connected name of a control: the text that assistive technology uses when it announces the field, and the text a user can click or tap to focus the field. A visible prompt nearby is not enough if it is not tied to the input in the HTML.
Placeholder text is not a label. A title attribute is not a reliable label. A floating label that disappears, or is not connected with a for attribute or a wrapping label, often fails the same test.
Why this matters
Forms are how people buy, book, donate, apply, and log in. If the field has no name, the task can stop right there. This issue maps to several WCAG criteria:
- 1.3.1 Info and Relationships — the label is a relationship that should be in the code, not only in the visual layout.
- 3.3.2 Labels or Instructions — people need labels or instructions when they have to enter information.
- 4.1.2 Name, Role, Value — a form control needs an accessible name.
Patterns that usually fail
Placeholder only. The hint vanishes when the user types, and it is not a dependable accessible name.
A visual label that is not connected. The word "Email" sits next to the box, but there is no label element, or the for and id values do not match.
Icon-only fields. A search or date field with only a magnifying glass or a calendar icon, and no accessible name.
Checkboxes and radios with clickable text that is not a real label. The text looks right, but a screen reader still does not associate it with the box.
A group of radios or checkboxes with no group name. Someone can hear "Yes" and "No" but not "Do you want email updates?"
The reliable fix, step by step
1. Use a visible label and connect it
<label for="email">Email address</label>
<input id="email" name="email" type="email" autocomplete="email">
You can also wrap the control:
<label>
Email address
<input name="email" type="email" autocomplete="email">
</label>
The first pattern is often easier to style. Either one works if the name and the control are tied together.
2. Keep a visible label, and use placeholder only as a hint
<label for="phone">Phone number</label>
<input id="phone" name="phone" type="tel" autocomplete="tel"
placeholder="201-555-0123">
Do not rely on the placeholder to act as the only prompt.
3. Name icon-only fields
If the design shows only an icon, keep a visible text label for most fields. When a search field is truly icon-only, give it an accessible name and, ideally, a visually hidden label that still becomes visible in some form:
<label for="site-search" class="visually-hidden">Search the site</label>
<input id="site-search" type="search" name="q">
<button type="submit">Search</button>
Hide the label with a CSS pattern that still leaves it available to assistive technology and to people who zoom or override styles. Do not use display: none or visibility: hidden on a label you still need.
4. Group related radios and checkboxes
<fieldset>
<legend>Preferred contact method</legend>
<label><input type="radio" name="contact" value="email"> Email</label>
<label><input type="radio" name="contact" value="phone"> Phone</label>
</fieldset>
fieldset and legend give the group a name. Each option still needs its own label.
5. Connect help text and error text
Use aria-describedby so hints and errors are announced with the field:
<label for="pw">Create a password</label>
<input id="pw" type="password" aria-describedby="pw-hint pw-error">
<p id="pw-hint">Use at least 12 characters.</p>
<p id="pw-error">The password is too short.</p>
When a field is invalid, set aria-invalid="true" and keep the error in text, not only in a red outline.
When is aria-label appropriate?
Use aria-label or aria-labelledby when you cannot use a native label, such as some custom widgets. If a visible label is already on the screen, prefer a native label or aria-labelledby pointing at that text, so the visible name and the accessible name match. Do not add ARIA on top of a working native label just to feel thorough. Native HTML is the simpler, more robust choice.
How to test by hand
- Click or tap the label text. The focus should move into the field.
- Tab through the form with the keyboard and look at every control.
- Turn on a screen reader and listen to each field. You should hear a clear name, and any required or error state.
- Fill the form incorrectly and confirm the error is announced with the field, not only shown as a color.
- Search the code for
input,select, andtextareaand check each one for a name.
Mistakes to avoid
- Using only placeholder text
- Hiding a label with
display: none - Reusing the same
idon more than one control, which breaksforconnections - Vague names such as "Value" or "Input"
- Reaching for ARIA when a
labelelement would do
Notes for common platforms
WordPress. Check comment forms, contact plugins, and checkout fields. Many themes style a placeholder and forget the label. WooCommerce forms can be overridden in the theme; test the live checkout, not only the default.
Shopify. Theme contact forms and app-injected forms often need a label added in the Liquid or the app settings. Test the cart note and any pop-up email forms too.
Webflow and similar builders. Add a Label element and connect it to the field in the settings. Do not delete the label to "clean up" the design.
React and other component libraries. A reusable Input component should require a label prop and generate matching id and htmlFor values. Do not spread input props onto a div that only looks like a field.
Related reading
- Keyboard navigation
- Visible focus styles
- The most common website accessibility problems
- WCAG 2.1 AA checklist
Official references: WCAG 2.1 Success Criterion 1.3.1, 3.3.2, and 4.1.2. If you want help reviewing the forms on a small-business site, text me at 910-931-0978 or visit my resources page.