StealThis .dev

Form — Real-time inline validation

A polished signup form that validates each field the moment it matters — on blur first, then live as you type, with debounced checks so messages never flicker. Specific error text, success checkmarks, an aria-invalid and aria-describedby wiring, a password strength meter with live rules, phone auto-formatting, and a submit button that stays disabled until every field is genuinely valid. Ends in an animated success state.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

Real-time inline validation

A five-field signup form (full name, email, password, confirm password, phone) that gives feedback exactly when it helps. Each field stays quiet until you leave it for the first time; after that it re-validates live as you type, debounced so the error text never jitters mid-keystroke. Valid fields earn a green checkmark, invalid ones get a red border, an icon, aria-invalid="true", and a specific message wired through aria-describedby — for example “Enter a valid email, like [email protected].” or “Passwords don’t match.”

The password field adds a strength meter and a live requirements checklist (length, mixed case, a number) that tick off as you satisfy them, plus a show/hide toggle. The phone field auto-formats US numbers as (415) 555-0182 while you type. The confirm field re-checks itself whenever the password changes, so the two never drift out of sync.

The “Create account” button is disabled until every field passes, and submitting runs a real validation pass that focuses the first invalid field if you try early. A successful submit shows a short loading state and then an animated confirmation panel addressed to the email you entered, with a “Create another account” action that resets everything. All status changes are announced through an aria-live toast, and the flow is fully keyboard-operable with visible focus rings.