Knowledgebase

Form Validation Patterns Print

  • frontenddevelopment, frontend, errors, guide, howto, solution, zillionkinghost, hosting
  • 0

Checking input well.

WHEN TO VALIDATE

After a field is completed, not while typing.

WHY

An error shown before someone has finished is hostile.

WHEN TO VALIDATE IMMEDIATELY

Once a field has already shown an error, so correction is confirmed.

WHAT TO VALIDATE ON SUBMISSION

Everything, again.

WHAT TO SHOW

What is wrong, specifically, beside the field.

WHAT NOT TO SHOW

A single generic message at the top An error list detached from the fields

WHAT TO ASSOCIATE

Each message with its field, so assistive technology announces it.

WHAT TO DO ON SUBMISSION FAILURE

Move focus to the first field with an error.

WHY

Otherwise a keyboard user must hunt for it.

WHAT TO PRESERVE

Everything entered.

WHY

Losing it is the most damaging form failure there is.

WHAT TO DEFINE ONCE

The validation rules, shared between client and server where the stack allows.

WHY

Divergent rules produce errors the user cannot resolve.

WHAT TO REMEMBER

Client validation is convenience. The server decides.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot