Skip to content
IndexRequest a UIAboutContact

Form Error Summary

Submit with mistakes: a summary on top links to each broken field, with an inline message at each one.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Clean UI mockup of a sign-up form after a failed submit: at the top a bordered summary box with the heading There is a problem and two underlined links, Enter your full name and Enter a valid email address, below it two labelled fields each with a red left border and a short red message under the field, the first field's text box outlined in red, a dark Submit button, light theme, flat modern style, calm and clear. Negative: pop-up alerts, heavy red backgrounds, text errors, clutter. Reduced motion: static design.

About this pattern

Definition

A good error experience tells people there is a problem, lists every problem in one place and takes them straight to each one. An error summary at the top of the form links to each field; inline messages sit next to the fields themselves; and focus moves to the summary on submit.

Purpose & UX principles

  • Move focus to the summary on submit and mark it role alert or give it a heading.
  • Each summary item is a link that focuses its field.
  • Show a specific inline message next to each field and connect it with aria-describedby and aria-invalid.
  • Clear each error as soon as the field is fixed.

Interaction states

  • A small form with two fields and Submit.

Motion specification

  • The summary appears instantly.
  • Reduced motion: nothing animates.

Responsive behaviour

  • Write errors that say how to fix the problem, not just that it is wrong.
  • Do not rely on red alone; add text and an icon.

Code

HTML
<div class="bx"><form id="fm" novalidate><div class="sm" id="sm" tabindex="-1" role="alert" hidden><b>There is a problem</b><ul id="sl"></ul></div><div class="fd"><label for="nm">Full name</label><input id="nm" type="text" autocomplete="off"><span class="er" id="en" hidden></span></div><div class="fd"><label for="em">Email</label><input id="em" type="text" autocomplete="off" inputmode="email"><span class="er" id="ee" hidden></span></div><button class="mini" type="submit">Submit</button></form><p class="out" id="out" role="status"></p></div>

Related patterns

Validation States

↗
Validation StatesInputs & Forms

Inline Alert Banners

↗
Inline Alert BannersFeedback & Notifications

Text Input

↗
Text InputInputs & Forms