This is a simple example of how to use HTMX to validate a form element.
htmx-validate
is a simple example of how to use HTMX to validate a form element.
<div htmx-error-for="email-input" is="htmx-validate"></div>
The element listens for the following events.
htmx-validate:error
- Triggered when the input is invalid.htmx-validate:success
- Triggered when the input is valid.