Forms Need Validation

Designing inline validation and error handling

Preparing audio… Please refresh page
Different ways to implement inline form validation.
Different ways to implement inline form validation.
Different ways to implement inline form validation.

Inline validation is a method to check the validity of input and give feedback before submission. It significantly enhances the usability and user experience of forms. This article explains inline form validation and error handling design techniques.

Validation

A form field displaying inline validation feedback for password strength.

An example of inline validation

The easy part of inline validation is the validation part. When an entry is validated, it can be communicated with a simple checkmark. Inline errors are more tricky.

Presenting inline errors

Inline errors should be presented with copy explaining the issue and how to fix it.

It can be presented in many ways including:

Above the field

A form field displaying inline validation feedback—showing a red error message.


Below the field

A form field displaying inline validation feedback—showing a red error message below the field.


Inline

A form field displaying inline validation feedback—showing a red error message, inline, next to the field.


As a tool-tip

A form input field with an inline validation tooltip—displaying a small floating message near the field to indicate an error, guiding the user to correct the input without disrupting the layout.


When should you provide inline validation and errors?

I have distilled five ways to provide inline validation and errors, each with its trade-offs and limitations. It’s important to address problems early and at their source, but it is easy to make matters worse with an inconsiderate approach.

1. When a user clicks into an input

A form field that displays gentle helper text when focused, rather than an immediate error—illustrating a user-friendly approach to inline validation that avoids premature warnings and reduces friction during input.

Immediately showing an error when a user clicks into a field is annoying, misleading, and distracting. It is like the form is yelling at you before you say anything. Talk about a bad relationship… However, this approach can be done well by presenting helper text in place of an explicit error until the error is confirmed, or the entry validated.

2. As a user types

A form field showing real-time validation feedback with each keystroke—used to indicate password strength or username availability, but potentially overwhelming the user with constant updates before they finish typing.

This approach annoys the user until the entry is validated. The user is harassed with each entered character, providing more frustration than help. It is like arguing with someone who is talking over you… However, this method provides helpful feedback on password strength and username availability.

3. Once the user reaches the character requirement

A form field using automatic validation for inputs with fixed character lengths, such as ZIP codes or credit card numbers—effective for standardized formats but potentially problematic for international users due to regional variations.

This validation method works for inputs with predictable character lengths like Zip codes, phone numbers, CC numbers, etc. However, this can be problematic for internationalization because the format is not always known.

4. When a user leaves the field

A form field that triggers validation feedback only after the user exits the input—offering a balanced approach that waits for complete input before showing messages, but may interrupt flow if feedback appears too late.

Providing feedback when the user leaves the field is probably the best default behavior because validation occurs after the entry is made explicit. However, it can disrupt a user’s flow because it provides feedback after the user has moved on.

5. When a user pauses

A form field using delayed validation that displays feedback only after the user pauses or exits the input—reducing disruption while still offering timely guidance to correct errors.

This technique provides feedback when a user pauses, mitigating the annoyance of inline errors as a user types and provides feedback when they pause or exit the input.

It is surprising how many forms don’t employ simple inline validation and error handling, and it is even more surprising how often it is poorly implemented.

Forms are quiet conversations between humans and machines. Validation, when done well, doesn’t interrupt—it listens, nudges, and guides. But when done poorly, it turns that conversation into a confrontation.

The details of good design aren’t cosmetic. They shape how people feel, how they move, how they think. Inline validation is one of those invisible patterns that either builds trust—or breaks it.

As designers, our responsibility is not just to make things work, but to make them feel effortless. Because the best forms don’t just collect data. They show that someone cared. I hope this article helps you design better web form validation.

If this article resonated, share it forward. Let’s raise the standard for interface design—one field at a time.

Andrew Coyle sitting in a building overlooking downtown San Francisco.
Andrew Coyle sitting in a building overlooking downtown San Francisco.
Andrew Coyle sitting in a building overlooking downtown San Francisco.

Written by Andrew Coyle

Andrew Coyle is a Y Combinator alum, a former co-founder of Hey Healthcare (YC S19), and was Flexport's founding designer. He also worked as an interaction designer at Google and Intuit. He is currently the head of design at Distro (YC S24), an enterprise sales AI company.