Skip to content

Search Feitio

↵ opens the first↑↓ chooseEsc closes

ErrorSummary

The summary of all of a form’s errors, at the top, each one leading to the field that needs fixing.

On this page

Playground

Errors
Background
HTML
<div class="feitio-error-summary" role="alert" tabindex="-1"><h3><svg class="feitio-icon" aria-hidden="true"><use href="/feitio/icons/sprite.svg#feitio-close"></use></svg>Fix 1 field to save</h3><ul><li><a href="#playground">Write a name for the reminder</a></li></ul></div>

When to use

When not to use

Examples

NameWrite a name for the schedule
Time
Use a time between 00:00 and 23:59

On the page

At the top of the content, before the form: the first thing seen and heard.

Show code
HTML
<div class="feitio-error-summary" role="alert" tabindex="-1">
  <h2>…Corrija 2 campos para salvar</h2>
  <ul>
    <li><a href="#nome">Escreva um nome para o agendamento</a></li>
    <li><a href="#hora">Use um horário entre 00:00 e 23:59</a></li>
  </ul>
</div>

Anatomy

  1. Box: the error background and the wine line around it.
  2. Title: how many fields and what to do.
  3. List: one link per error, with the field’s sentence.

Do and don’t

Do

Even with a single error, the summary shows.

Don’t

Oops! The form has errors.

Without the list, the person hunts for the errors, and "Oops" apologizes without helping.

Writing

Where it goes

Accessibility

Attributes

AttributeValuesWhat for
class="feitio-error-summary"requiredThe error background and the wine line.
role="alert"alwaysAnnounced when it appears.
tabindex="-1"alwaysSo focus can go to it.
a href"#id-do-campo"Each error leads to its field.
Top