Examples · Forms

Inline validation

wireForm() on a server form: rules, blur-then-live, no JavaScript required to submit.

The form is a normal server form and works without JavaScript. wireForm() layers rules on top, uses the browser's Constraint Validation API for messages and accessibility, and shows errors after you leave a field, then live.

Playground

What to notice

  • aria-invalid and :user-invalid are set for you; the red border is one CSS rule.
  • The password rule lives once; “Repeat” compares against it with matches().
  • Without JavaScript the same form posts to /signup and the server validates.

Type a 4-character password and tab away.