News for hackers. Stuff that matters.
Re:HTMx by listenallyall on Thursday May 25, 2023 @11:47PM (#36079595)
HTML already has a native validation API for form elements. https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_va... HTMX wraps that with some custom events and enables you to use the same API for non-form elements.

In the example above, if you need custom validation logic, you could handle the HTMX:validation:validate event with any normal JS event handler.

Of course, it's up to you to decide how much effort to put into client-side validation that can be easily bypassed.

There are no comments on this comment yet.