VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

How Form Validation Works | Catch Errors Without Trapping the User

Three secondary students review open books and notes together in a classroom.

Form validation works by detecting missing, malformed or impossible input while still allowing valid users to complete the transaction.

Validation is necessary because systems need usable data.

It becomes harmful when the validator knows less about reality than the user and still refuses to listen.

This article is the second pillar of How Digital Forms Fail.


The Core Idea: Validation Protects the Transaction

Validation should prevent data states that would break the process, not enforce arbitrary preferences.

The W3C Forms Tutorial recommends validating input to help users avoid mistakes, while also noting that client-side validation does not replace server-side validation for security.

Good validation protects both user and system.


Validate What Matters

A useful rule should answer a real downstream requirement.

If a date must be after today because the service cannot process past dates, validation is meaningful.

If a surname must contain at least three letters because the developer assumed names are long, the rule is unjustified.

Every validator should have a reason.


Prevent Errors Before Detecting Them

Clear labels, examples and instructions are the first validation layer.

It is better to prevent a predictable error than to display an excellent error message afterwards.

W3C guidance treats labels and instructions as part of making form completion reliable.


Validate at the Right Time

Validation on final submission is often too late for simple field errors.

Validation on every keystroke is often too early.

Useful moments include leaving a completed field, advancing to the next step or submitting the current page.

The timing should give the user a fair opportunity to answer.


Do Not Punish Partial Input

A date field containing ‘1’ is not necessarily invalid while the user is still typing ‘12/10/2026’.

Premature error states create unnecessary alarm.

Wait until the input can reasonably be judged.


Distinguish Syntax From Meaning

Syntax asks whether the answer has the expected shape.

Meaning asks whether the answer makes sense for the transaction.

An email can be syntactically plausible and still unreachable.

A date can match the format and still be outside the allowed period.

Different checks may happen at different stages.


Use Browser Capabilities Without Depending on Them Alone

HTML input types and required attributes can provide useful built-in behaviour.

W3C notes that these controls can help with common input such as email, dates and numbers.

Custom error handling still needs to be accessible and clear.


Validate on the Server Too

Client-side checks improve experience.

They can be bypassed or fail.

Server-side validation protects the authoritative transaction state.

The user should receive a comprehensible response when server-side validation finds a problem.


Keep Error Messages Specific

‘Invalid’ is weak.

‘Enter a date in DD/MM/YYYY format’ is better when format is the issue.

‘Choose a date on or after 3 October 2026’ is better when the allowed range is the issue.

The message should name the repair.


Keep Error Messages Near the Error

The user should not need to hunt.

A top-of-page error summary can orient the user, while a field-level message explains the local repair.

Both layers can be useful on longer forms.


Do Not Rely on Colour Alone

An error should remain understandable without red styling.

Use text and accessible relationships between the error and the field.

Visual emphasis should support meaning, not carry it alone.


Preserve Valid Input

One invalid field should not erase twenty valid answers.

Recovery should keep everything that can safely remain.

This reduces rework and prevents secondary errors created during re-entry.


Focus Should Move Intelligently

After failed submission, the user should be able to find the first error efficiently.

For keyboard and assistive-technology users, focus and error summaries can make a large difference.

The form should route attention to the repair.


Do Not Reject Harmless Formatting

Spaces, hyphens, capitalisation or punctuation can often be normalised rather than rejected.

If the system can safely interpret ‘9123 4567’ and ‘91234567’ as the same phone number, forcing one cosmetic representation may create unnecessary friction.

Be strict about meaning, not aesthetics.


Do Not Overvalidate Names

Names can contain spaces, apostrophes, hyphens, diacritics and scripts unfamiliar to the designer.

Validation should follow the actual identity requirement.

A rigid regex can exclude valid people.


Do Not Overvalidate Addresses

International addresses resist one universal template.

If the service only operates locally, local constraints can be appropriate.

If users come from multiple countries, validation must reflect that reality.


Validation Should Explain Eligibility Failures

Some failures are not formatting errors.

The user may be ineligible for a service or option.

The form should explain the relevant rule and, where possible, the next path.

A dead end without explanation turns policy into frustration.


Validation Should Distinguish User Error From System Error

‘Your postcode is invalid’ is wrong if the postcode service is down.

The system should not blame the user for infrastructure failure.

System errors need different language and recovery.


Network Failure Is Not Validation Failure

A submission can contain perfectly valid data and still fail to reach the server.

The interface should preserve the data and explain that the transmission failed.

Do not force the user to infer whether the problem was their answer or the network.


Use Cross-Field Validation Carefully

Some rules depend on several fields.

End date may need to follow start date. Age may affect consent requirements. One answer may make another field mandatory.

When a cross-field rule fails, the message should explain the relationship, not merely mark both fields red.


Conditional Requirements Must Stay Consistent

If a field becomes required only after one answer, the interface, client validation and server validation should all agree.

Inconsistent layers create impossible forms: the screen says optional while the server says required.


Validation Rules Need Version Control

Requirements change.

Eligibility dates, supported formats and business rules can evolve.

The validator should not quietly enforce an outdated rule after the visible form has changed.

Validation is procedure encoded in software.


Test Boundary Values

Many validation bugs live at edges.

  • Exactly the minimum age.
  • Exactly the deadline.
  • Zero.
  • Maximum length.
  • Leap day.
  • Midnight.
  • One character.
  • One item selected.
  • International prefix.
  • Empty optional field.

Boundary testing reveals whether the rule matches the intended condition.


Test Real-World Diversity

Validation should be tested with more than ideal sample data.

Use long names, short names, non-Latin characters, unusual but valid addresses, assistive technology and mobile input.

A validator that only works for the design team’s test accounts is not ready.


Validation in Education

A school or tuition form may validate level, subject and dates.

It should be cautious about validating human judgments.

‘Student is weak’ is not a machine-verifiable state.

Collect the report, then diagnose separately.


Validation in Mathematics

A diagnostic tool may validate that a response is numerically formatted while still needing mathematical interpretation of method.

Correct final answers can contain invalid reasoning, and incorrect answers can contain useful partial reasoning.

Do not collapse educational diagnosis into input-format validation.


Validation in English

Language answers often have legitimate variation.

Automated validation should be conservative unless the task truly has one bounded answer.

A form asking for a composition concern should not enforce one vocabulary or phrasing pattern.


The Validation Severity Ladder

  • Preventive instruction — tell the user what is expected.
  • Soft warning — unusual but still possible.
  • Correctable field error — cannot proceed until repaired.
  • Cross-field conflict — two answers cannot both be true under the rule.
  • Eligibility failure — transaction cannot proceed on this path.
  • System failure — user input may be valid but service cannot complete the check.

Different failure types deserve different language and recovery.


The Validation Test

  • What real requirement does this rule protect?
  • Can a valid real-world answer fail the rule?
  • Is the requirement explained before error?
  • Does validation occur at a fair time?
  • Does the error say how to fix the problem?
  • Can the user find the field?
  • Is valid work preserved?
  • Do client and server rules agree?
  • Are system failures distinguished from user errors?
  • Have boundary and diverse real-world cases been tested?

The Deeper Principle: Validation Should Be Strict About the Transaction and Flexible About Human Reality

A validator is not there to force users into the designer’s preferred shape.

It is there to protect the conditions required for a valid transaction.

The closer the rule stays to that purpose, the fewer valid users it will reject.


Across the eduKate Ecosystem

eduKateSG owns the general digital-form mechanism. Translate Forms, Applications and Registration Documents owns multilingual fidelity of questions and eligibility meaning, while Internationalize Forms and Validation owns locale-sensitive names, phone numbers and addresses. Localize Multi-Step Forms owns translation of conditional logic and progress. How Procedures Fail supplies the instruction layer; How Warnings Fail supplies the error-signal layer; and How Approvals Fail helps distinguish a submitted request from an approved state.


Sources and Further Reading

W3C Web Accessibility Initiative — Forms Tutorial

W3C WAI — Labeling Controls

W3C WAI — Form Instructions

W3C WAI — Validating Input

GOV.UK Design System — Question Pages

GOV.UK Design System — Check Answers

GOV.UK Design System — Confirmation Pages


Continue the Series

How Digital Forms Fail | Why Ambiguous Fields, Bad Validation and Unclear Submission States Lose Users and Data

How Form Field Design Works | Ask One Clear Question at a Time

How Form Submission States Work | Make Save, Submit, Success and Recovery Unambiguous

eduKateSG