We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS


The HTMLFormElement.reportValidity() method returns true if the element's child controls satisfy their validation constraints. When false is returned, cancelable invalid events are fired for each invalid child and validation problems are reported to the user.




document.forms["myform"].addEventListener('invalid', function() {
  //Optional response here.
}, false);

document.forms["myform"].addEventListener('submit', function() {
}, false);


Specification Status Comment
HTML Living Standard
The definition of 'HTMLFormElement.reportValidity()' in that specification.
Living Standard  
HTML 5.1
The definition of 'HTMLFormElement.reportValidity()' in that specification.
Recommendation Initial definition

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support40 ?49 No Yes Yes
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support4040 ? ? ? ?4.0

Document Tags and Contributors

Last updated by: fscholz,