htmx 4.0 is under construction — migration guide

Validation

Validate forms using HTML5 validation APIs

Htmx integrates with the HTML5 Validation API and will not issue a request for a form if a validatable input is invalid.

Non-form elements do not validate before they make requests by default, but you can enable validation by setting the hx-validate attribute to “true”.