Components
← All components

Form Validation

stimeo--form-validation

Orchestrates native constraint validation: when to check, blocking submit, focus, and routing messages into form fields.

The stimeo--form-validation controller is the timing layer over the browser's native Constraint Validation API. It suppresses the native error bubbles (novalidate), checks every control on submit — cancelling an invalid submission before any other submit handler reacts — validates a field on blur once touched, re-validates it on input, treats change as a committed interaction, and moves focus to the first invalid field's visible control. Each control's validationMessage is rendered through its stimeo--form-field outlet, so the ARIA wiring lives in exactly one place. Rules and messages stay native (required, type, pattern, setCustomValidity); the controller invents neither. Rich widgets join through a validatable mirror — an input with the hidden attribute, not type="hidden" — with no extra JavaScript.

running
Plan

Rules are plain HTML attributes (required, type="email") — including the listbox, whose committed value lives in a validatable mirror (an input with the hidden attribute). Error text comes from the browser in its own UI language; fields validate on blur, recover as you type, and an invalid submit is blocked with focus moved to the first invalid field.