Skip to main content
WCAGrules
Quick navigation

Do not leave labeled controls without a name

The word Quantity sits above the box in plain sight, and nothing in the code ties the two together, so the control has no name at all. F111 is the failure technique for that, and a match is a defect rather than a technique. Three checks make it up. The control has a visible label, the control has an accessible name, and the name contains the visible text. F111 is the middle check failing, which means no name whatsoever. Where a name does exist and says something other than the label, that is a different failure with its own page. The repair is smaller than it sounds, too. The words are already written and already on the screen, so this is a matter of connecting a label to its control rather than of writing anything new.

How we find it in an audit

Every control showing a visible label gets read out of the accessibility tree, and the only question is whether a name came back at all. Divs and spans doing a label's job are the usual source, because they look right on the screen and connect to nothing underneath. Custom components get extra attention, since a wrapper often holds the visible text while the real input sits two levels down with nothing attached to it. Each finding quotes the visible words, so whoever picks up the ticket knows what the name should say.

How affected users experience it

A screen-reader user hears edit text and nothing more, while the word telling everybody else what to type sits two pixels above it. Voice-control users get the sharper version, because their whole method is saying the visible word out loud and there is nothing behind it to match. Click Quantity does nothing at all. The label is right there on the screen, read by everyone except the software that needed it most.

Passes vs. fails

Passes: a label that stays put. Fails: placeholder-only fields.

Passes

<label for="qty">Quantity</label>
<input type="number" id="qty">

Fails

<div>Quantity</div>
<input type="number">

How this gets tested

The W3C publishes test rules that define what a checker looks for here.

The other techniques filed under this rule

52 guides on this site are filed under 1.3.1 Info and Relationships. W3C documents this one as a failure of that rule, so it describes a way the rule gets broken rather than a way to pass it.

This guide is our interpretation of W3C technique F111: Failure of Success Criteria 1.3.1, 2.5.3, and 4.1.2 due to a control with visible label text but no accessible name. W3C publishes its techniques as guidance rather than as the standard, and says so on every one of them. The success criterion is what conformance is measured against, and a technique is one documented way to meet it.

Go somewhere useful

Find tools, resources and your workspace.

29 destinations