Web/API/HTMLFormElement/reportValidity

From Get docs


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.

Syntax

HTMLFormElement.reportValidity()

Return value

Boolean

Example

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

Specifications

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

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
reportValidity Chrome

Full support 40

Edge

Full support 17

Firefox

Full support 49

IE

No support No

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support 40

Chrome Android

Full support 40

Firefox Android

Full support Yes

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support 4.0

Legend

Full support  
Full support
No support  
No support