Live demo — this example is server-driven; run the showcase locally for the interactive version.

Form validation

Server-driven form validation. The form posts to Quarkus on submit; the server validates every field and returns the form fragment with PatternFly error states and helper text swapped back in — no client-side validation logic.

Examples

Server-side validated signup

Try submitting an empty form, a 2-character username, an invalid email, or the username admin (a server-only "already taken" rule). Validation runs at /api/htmx/form-validate.

Documentation

Usage

One validator, on the server. Rules that need server data anyway (uniqueness, permissions) live in one place, and the browser just renders the returned fragment — the same PF helper-text pattern used by the form component, with error states applied server-side.

Don't rely on native popups. The inputs deliberately avoid browser-native validation UI (see the text input guidance); the server response is the single source of error presentation, announced via the helper-text live region.