"Form elements must have labels": how to label the boxes on your forms
Published · Updated
“Form elements must have labels” is the error you’ll see in axe. Lighthouse calls it “Form elements do not have associated labels”, WAVE calls it “Missing form label”, and the Tabwise scan calls it “Form fields without labels”. They all mean the same thing: a box on one of your forms has no name.
A label is the word or two that tells people what goes in a box: “Your name”, “Email”, “Check-in date”. Without one, a screen reader just says “edit text”. The person using it has to guess what to type.
Hotels have this problem most. In our study of Irish hotel and accommodation websites, one in six (16% of 608) had a form box with no label. That’s often the booking box on the homepage. Across all the Irish business websites in our studies, it was 4.5% of 12,397.
Who this affects
Mainly people who use a screen reader. That’s software that reads the page aloud, used by blind people and many people with low vision. When they reach a box, they hear its label. No label, no clue.
It also affects people who use voice control. They move to a box by saying its name, like “click Email”. And it helps anyone with shaky hands. When a label is set up properly, clicking the label puts the cursor in the box, so there’s a bigger area to click.
Grey text inside the box isn’t a label
Many forms skip the label and put faint grey text inside the box instead, such as “Enter your email”. That’s called placeholder text.
It disappears as soon as you start typing. So if you get distracted, or come back to check your answers, you can’t see what the box was for. That’s hard for anyone, and harder still for people with memory or attention difficulties. Placeholder text is often too faint to read as well, which our guide to fixing colour contrast covers.
Here’s the catch: automated checkers, including ours, accept placeholder text as a name. So a box with only grey text inside won’t show up in your scan results. Check your forms by eye for that one.
Where it turns up
These are the forms we see it on most:
- Booking boxes: check-in date, check-out date, number of guests.
- Contact and enquiry forms: name, email, phone and message.
- Newsletter sign-ups: a single email box in the footer or a pop-up, often with no label at all.
- Search boxes: a box next to a magnifying glass.
Booking boxes and newsletter pop-ups often come from another company’s widget or app, not from your own website.
How to fix it
Every box needs a visible label, placed above it or beside it. “Email” is better than nothing. “Your email address” is better still.
Run our free scan first. The report tells you which boxes have no label. Our guide to reading your scan report explains each part of it.
WordPress and WooCommerce
Most forms on WordPress sites come from a form plugin. Open the form in the plugin and look at each field’s settings for a label. Fill it in, and make sure it isn’t set to hidden.
If you use Contact Form 7, its help page on adding text labels to fields explains how. For other form plugins, check that plugin’s own help pages. Then run our free scan again to check.
Wix
Wix has a help page on creating an accessible Wix form. It shows where to give each field a title, and how to make sure the title is shown.
Squarespace
In a Squarespace form block, each field has a label setting. Squarespace’s guide to form fields shows where to find it.
Shopify
The contact form and newsletter box usually come from your theme. If our scan flags one, contact your theme’s developer. If the form comes from an app, such as a pop-up, contact that app’s developer.
Booking widgets and other third-party forms
You can’t change these yourself, but you can ask the company that supplies them. Send them this:
Our accessibility scan says some boxes in your booking form have no label (WCAG 2.1 success criterion 4.1.2). Can you give every box a visible label, like “Check-in date” and “Number of guests”? When will that be fixed?
Keep their answer. If you’re covered by the accessibility rules, it helps with your accessibility statement.
If someone else built your site
Copy this and send it to your web person:
Some form fields on our website have no label, which fails WCAG 2.1 AA (success criterion 4.1.2). Please give every field a visible label that’s connected to it in the code, including the booking, contact, newsletter and search boxes. Placeholder text on its own isn’t enough. Can you send me a list of what you changed?
How to check it’s fixed
Run our free scan again. It lists any boxes that still have no label. It checks your homepage and up to four pages linked from it, so look at your other contact and booking pages too.
Then do a quick test by hand on each form. Click on each label. The cursor should jump into the box next to it. And check that no box relies on grey text inside it to say what it’s for.
For other pages, try the free WAVE checker from WebAIM. Type in the address of any page and look for “Missing form label” in the results.
For your web developer
axe reports this as label, against WCAG 2.1 success criterion 4.1.2, Name, Role, Value. Success criterion 3.3.2, Labels or Instructions, is the reason for a visible label.
- Connect a visible
<label>to every<input>and<textarea>, either withforandidor by wrapping the field:
<!-- Before -->
<input type="email" name="email" placeholder="Enter your email">
<!-- After -->
<label for="signup-email">Your email address</label>
<input type="email" id="signup-email" name="email" autocomplete="email">
- axe accepts
placeholder,title,aria-labeloraria-labelledbyas a name, so a placeholder-only field passes the automated check. It still fails 3.3.2 in practice, because the hint disappears on input. - Keep the label visible. Voice control users say the words they can see, so a hidden label or
aria-labelalone leaves them guessing. - Check fields injected by booking engines, chat widgets and newsletter pop-ups, which often load after the page and aren’t in the theme code.
- Drop-down menus are a separate check,
select-name. See fixing drop-down menus with no label.