HTML 'required' attribute not working #2493
fullstackplus
started this conversation in
General
Replies: 1 comment 4 replies
-
I've realized that you must put the You need to rely on the button begin It seems that validation is a "form"-thing, so if you by-pass normal form submission, you won't get validation. This is not very clear in the docs. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm trying out HTMX with Sinatra, using a simple submission form as an example.
I've noticed that when I submit the form using HTMX, the
required
attribute stops working on input elements — and I'm able to POST a form with empty input fields. When I remove the HTMX attributes from thebutton
element, and submit the form the traditional way, everything works as expected.Using
aria-required="true
instead ofrequired
doesn't make any difference.What's going on? The code:
Beta Was this translation helpful? Give feedback.
All reactions