-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setCustomValidity() seems pointless on <fieldset> #6870
Comments
The idea was that because it's a Listed element it should have the same general-purpose APIs as the other Listed elements: https://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-August/064766.html. I'm not sure how much sense this makes though. I'm also not sure how much sense it would make for constraint validation to check |
https://jsbin.com/nucekozegi/1/edit?html,output (see #6868 for motivation) is an example where I think it would make sense. I.e. saying "something in how you've input into this fieldset is invalid", when it might not be possible to pinpoint specific elements. |
FWIW, we often have forms where one of two fields is required (e.g., first or last name, phone or email, etc.). Since a |
Fieldset supports Addresses are a good example where a combination of address fields may satisfy the application's requirements. Independent validation of individual fields in this use case is not really helpful because their validity depends on what else has been done in other fields:
The application could run that custom validation logic on submit and set an appropriate message based on what it finds using |
Another example would be date inputs. For credit card date expiry the A |
Constraint validation only checks submittable elements. So if you do
fieldset.setCustomValidity("Something is wrong!")
this has no impact on preventing form submission.I think constraint validation should also check fieldsets?
There might be other elements with the constraint validation API added to them but outside the submittable elements list...
The text was updated successfully, but these errors were encountered: