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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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
requiredattribute stops working on input elements — and I'm able to POST a form with empty input fields. When I remove the HTMX attributes from thebuttonelement, and submit the form the traditional way, everything works as expected.Using
aria-required="trueinstead ofrequireddoesn't make any difference.What's going on? The code:
Beta Was this translation helpful? Give feedback.
All reactions