Skip to content
Performance & Accessibility

How to Get Marking Required Fields Right

Showing which form fields must be completed, in a way that works visually and for assistive technology.

Marcus Adeyemi Technical Director 2 min read 20 views
How to Get Marking Required Fields Right

Why does it matter?

Asterisks alone are ambiguous, and required state must be communicated programmatically as well as visually.

What are the numbers?

  • required attribute communicates the requirement to assistive technology
  • Visual indication needs explanation, not just a symbol
  • Optional marking marking optional fields can be clearer when most are required
  • Consistency the same convention should apply across a site

What should I do?

  1. Use the required attribute
  2. Explain the convention at the start of the form
  3. Mark the smaller group, whether required or optional
  4. Keep indication consistent sitewide
  5. Test announcements with a screen reader
What to do and what to avoid with marking required fields, side by side
Good practice against the usual mistakes, from the sources listed below.

What should I avoid?

Avoid:

  • Asterisks with no explanation
  • Required state shown only by color
  • Different conventions on different forms
  • Validation that only appears after submission

When should I get help?

Short answer Bring in help when forms are a main conversion path.

Where this comes from

The figures and practices above come from the sources listed.

Working on something like this?

We take on Performance & Accessibility work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.

Where to go next

Spotted something wrong? Report an error on this page. We correct on the page and say what changed.

All services

The work behind this article, and what it costs.

Marcus Adeyemi

Builds and maintains the web work. Writes about front-end architecture, performance, accessibility and the unglamorous parts of keeping a site alive.

Keep reading

More in Performance & Accessibility