liveBook · Manning

Form label

As explained in Architecting Accessibility

Text associated with a form control that identifies its purpose or the information it requires.

A form label tells people what a control is for or what information it requires. Give each user-facing control an accessible name and, in most cases, a visible label programmatically associated with it. Keep the label available while people enter data; a placeholder disappears and can leave users unsure what the field asks for. section 6.7 section 6.1

Clear labels help people complete forms, including users of assistive technology and people with cognitive disabilities.

  • Describe the control’s purpose clearly; add instructions when the label alone cannot explain a required format or other constraint. section 6.7
  • Do not use a placeholder as the only label: its disappearance can make a field harder to understand while completing the form. section 6.1
Listing 6.1 A form markup with a number of accessibility concerns
<p>
  <form action="..." method="post" novalidate>
    <div class="form-row">
      <input name="name" type="text" placeholder="Owner's Name" /> #A
    </div>
    <div class="form-row" class="error"> #B
      <input name="email" type="text" placeholder="Owner's Email" />
    </div>
    <div class="form-row">
      <input name="breed" type="text" placeholder="Dog's breed" />
    </div>
    <div class="form-row">
      <input name="age" type="text" placeholder="Dog's age" /> #C
    </div>
    <div class="form-row">
      <input name="complaint" 
        type="text" 
        placeholder="What is the complaint?" />
    </div>
    <!-- Submit -->
    <div class=”primary-button” id="btn-submit"> #D
      Go
    </div>
    <div class=”primary-button” id="btn-reset"> 
      Reset
    </div>
  </form>
</p>

The example markup uses placeholders instead of labels for owner name, email, dog breed, age, and complaint fields. section 6.1

How Architecting Accessibility covers it

How deep it goes
Defines label purpose and association, then contrasts persistent labels with disappearing placeholders; does not provide a corrected implementation.
Examples
Contrasts missing labels in a dog-registration form, including owner email, dog age, and complaint fields.
What you can do after
Evaluate form controls for clear purpose, persistent labels, and missing input guidance.
How it connects
Connects form labels to accessible names, form instructions, and assistive technology use.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Architecting Accessibility. The section links point to the parts of the book it draws on.