-
-
Notifications
You must be signed in to change notification settings - Fork 923
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
Form checkValidity() sometimes returns true when form fields are invalid #2256
Comments
So here's what I see: when you click the |
Personally, I'd like to double-check whether The check here and here is required to work around this IE/old Edge bug and an IE9 bug referenced here, and probably should have a comment added for it at least. But in summary, it's just a case where we're unnecessarily checking |
@isiahmeadows I agree with your assessment. The |
it's still an issue |
When using
m.withAttr()
to maintain aninput
value
, the form'scheckValidity()
method sometimes returnstrue
when form fields are not valid. This happens on the second and subsequent submissions.Expected Behavior
checkValidity()
should always returnfalse
if any fields within theform
aren't valid, eg: https://codepen.io/kevinkace/pen/rqKroe?editors=1011Current Behavior
checkValidity()
returnstrue
when a field contains an invalidvalue
, on the second and subsequent submits. eg: https://codepen.io/kevinkace/pen/XxYBoK?editors=0011Steps to Reproduce (for bugs)
https://codepen.io/kevinkace/pen/XxYBoK?editors=0011
m.withAttr()
to set thevalue
of aninput
with aminlength
, eg:onsubmit
handler to theform
element, eg:button
to the form, egm("button", "submit")
button
,checkValidity()
should returnfalse
button
,checkValidity()
now returnstrue
Context
I'm trying to used HTML form validation for form submition.
Your Environment
The text was updated successfully, but these errors were encountered: