Pass the menu and read the page

SignupFolio

Visible labels and accessible names: 4 checks for forms

The words on a signup control should also be its accessible name

The core rule for your signup form is simple: the words a person sees on a control must also be the words the screen reader announces. W3C states that the intent of this success criterion is to ensure that the words which visually label a component are also the words associated with the component programmatically, according to W3C. This means the visible text and the accessible name are not just similar; they must align so that the programmatic association matches the visual label.

When you name a button or field, you are creating two things at once: the visual label for sighted users and the accessible name for assistive technology. W3C advises to make the control’s text label and name match where practical, according to W3C. This guidance applies to every interactive element on your signup page, from the primary submit button to each text input. If the visible label says "Create Account," the accessible name should contain those same words. If the label says "Email," the accessible name should be "Email."

This alignment is the foundation for the four checks you will run on your form. The first check is whether the visible words are part of the accessible name. The second is whether a speech user can say the visible label. The third is whether a text field has a visible label rather than only in-field text. The fourth is whether a control with no visible text still has an accessible name. The first two follow the W3C aim, the third follows GOV.UK, and the fourth follows MDN.

Key takeaways for visible label accessible name match

Most content has an accessible name generated from its immediate wrapping element's text content, according to MDN. All text inputs must have labels, and in most cases the label should be visible, according to GOV.UK.

  • Keep the visible words inside the accessible name so the programmatic association matches the visual label.
  • Ensure the visible label is present and not replaced by in-field text alone for text fields.
  • Verify that a control without visible text still has a programmatically associated accessible name.
  • Confirm that the visible words a speech user says in a command match the visible characters on the control.

Read one signup button aloud and check that those same words are in its accessible name.

Reference table of name rules by publisher

The following table summarizes the specific guidance each publisher provides regarding how visible labels relate to accessible names and form controls.

PublisherRule or DefinitionSource
W3CThe intent is to ensure that the words which visually label a component are also the words associated with the component programmatically.W3C
MDNMost content has an accessible name generated from its immediate wrapping element's text content.MDN
GOV.UKAll text inputs must have labels, and in most cases the label should be visible.GOV.UK
WebAIMA label describes the function of a form control, and generally appears adjacent to it.WebAIM

MDN explains the default mechanism for generating accessible names, noting that most content has an accessible name generated from its immediate wrapping element's text content, according to MDN. This indicates that the visible text within the wrapping element often serves as the source for the accessible name without additional markup.

Why speech control uses the visible words

People who operate with voice interaction use the visible labels in their commands, according to W3C. When a visitor speaks a command to a browser, they use the words printed on the screen. If the visible text on a button reads "Start Free Trial," speech users can say that phrase, and the accessible name should contain it. The user does not guess an internal code or an alternative name; they rely on the text they can see. This direct link between visual text and voice command makes the visible label the primary interface for speech users.

The alignment between what is seen and what is named matters for the overall experience. Users typically have a much better experience if the words and characters in the visible label of a control match or are contained within the accessible name, according to W3C. This principle applies to every control on a signup form, from the primary submit button to secondary links. If the visible label is "Sign Up" but the accessible name is "Submit Form," a voice user saying "Sign Up" may fail to activate the control. The mismatch creates friction because the user’s spoken command does not align with the machine-readable name.

For a marketer naming buttons and fields, this means the visible text is not just a design element; it is the functional key for voice interaction. When you choose words for a button, you are also choosing words speech users may say. If the visible label is short and clear, the voice command is short and clear. If the visible label is ambiguous or missing, speech users have fewer clear words to say.

What to do when a button has no visible text

When a signup control lacks visible text, you must supply an accessible name through markup. MDN notes that a common example of such an element is a button containing an SVG icon without any text, according to MDN. In these cases, the visible label does not exist, so the accessible name must be generated from other sources to ensure the control is identifiable.

MDN explains that most content has an accessible name generated from its immediate wrapping element's text content, according to MDN. This mechanism applies to elements where text is present in the surrounding structure. However, for icon-only buttons, the wrapping element contains no text, so supply an accessible name and check the computed result.

To address this, MDN states that both provide an accessible name for an element, referring to the aria-label and aria-labelledby attributes, according to MDN. These attributes allow you to define the name directly in the markup when visible text is absent. By adding an aria-label attribute to an icon button, you ensure the control has a name that assistive technologies can read.

When naming these controls, choose words that describe the action clearly. The accessible name should match the intent of the button, even if no visible label is present. This practice aligns with the broader goal of keeping visible and accessible names consistent. If you use an icon that implies a specific function, the aria-label should state that function explicitly.

Consider the placement of these attributes in your HTML. The aria-label attribute should be added directly to the button element. This ensures the name is associated with the correct control. Text outside the button can name it when linked with aria-labelledby. MDN notes that the name is generated from the immediate wrapping element's text content, so check the computed name of an icon-only button, according to MDN. For more on ARIA mistakes, see signup accessibility.

Illustrative example: one button and one icon

A signup form has a button that reads "Create account" and a search icon with no text. For the text button, the accessible name should contain "Create account". For the icon, add an aria-label such as "Search", then check the computed name in your browser. Repeat for each field.

Where the label sits above a text field

Place the visible label directly above or adjacent to the text field. WebAIM defines a label as describing the function of a form control, such as a text area, checkbox, radio button, or menu, and states that it generally appears adjacent to it WebAIM. This placement ensures the visual cue remains connected to the input element for sighted users.

GOV.UK Design System specifies that all text inputs must have labels, and in most cases the label should be visible GOV.UK. Keeping the label visible maintains a consistent visual reference point. When a user navigates to the form control, a screen reader announces the text label, according to WebAIM WebAIM. This announcement relies on the label being programmatically associated with the input, not just visually placed near it.

Avoid using in-field text as a substitute for a label. GOV.UK Design System advises against using in-field text in place of a label, or for hints or examples GOV.UK. A persistent visible label remains available throughout the interaction.

For your signup form, ensure every text input has a distinct, visible label positioned near the field. Do not rely on in-field text to identify the field’s purpose. Check that the label text matches the accessible name so that both visual and assistive technology users receive the same information. Verify that the label remains visible after the user enters text. This practice aligns with the guidance from GOV.UK and WebAIM on maintaining clear, persistent field identification.

Next step: today, check one signup button against this list, then go through the signup release review.

Failures these sources name when the name and label differ

W3C documents specific failure names for situations where the visible label and the accessible name do not align on a form control. These names help you identify exactly which part of your markup is causing the mismatch.

F96: Accessible name missing visible label text

W3C defines F96 as a failure due to the accessible name not containing the visible label text, according to W3C. This applies when a control displays words on screen, but the accessible name computed by the browser omits those words. For example, if a button shows "Sign up" but its accessible name is "Submit," the visible label text is not part of the name. W3C lists this under the Understanding Success Criterion 2.5.3: Label in Name page, according to W3C.

F111: Visible label text but no accessible name

W3C also names F111 as a 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, according to W3C. This occurs when a control has visible text, yet the browser cannot compute any accessible name for it at all. W3C ties this failure to three success criteria simultaneously: 1.3.1, 2.5.3, and 4.1.2, according to W3C. If a signup button shows "Sign up" but has no accessible name, this is the failure pattern W3C describes.

Techniques W3C pairs with these failures

W3C lists two techniques on the same page that address these failures. G208 is titled "Including the text of the visible label as part of the accessible name," according to W3C. G211 is titled "Matching the accessible name to the visible label," according to W3C. W3C presents G208 and G211 as techniques under the Understanding Success Criterion 2.5.3: Label in Name page, according to W3C.

FAQ: Visible label accessible name match

Why does W3C want the visible label inside the accessible name?

The intent of this success criterion is to ensure that the words which visually label a component are also the words associated with the component programmatically, according to W3C. This requirement aligns the visible text with the data exposed to assistive technologies.

What does GOV.UK say about in-field text?

The guidance advises against using in-field text in place of a label, or for hints or examples, according to GOV.UK. This instruction distinguishes persistent labels from temporary in-field content.

Where does MDN say most accessible names come from?

MDN says most content gets its accessible name from its immediate wrapping element's text content, according to MDN.

Which W3C failure name covers a visible label that is missing from the accessible name?

The specific failure is named "F96: Failure due to the accessible name not containing the visible label text," according to W3C. This identifies the specific mismatch between visual and programmatic labeling.

Sources and check date

Related posts

More posts