Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

HTMLFormElement.reportValidity()

Este articulo necesita una revisión técnica. Cómo puedes ayudar.

Nuestros voluntarios aún no han traducido este artículo al Español. Únete a nosotros y ayúdanos a traducirlo

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

This API is not implemented in Firefox. Vote for Bug 1088761 if you think, that it should be prioritized.

Syntax

HTMLFormElement.reportValidity()

Example

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

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

Specifications

Specification Status Comment
WHATWG HTML Living Standard
The definition of 'HTMLFormElement.reportValidity()' in that specification.
Living Standard  
HTML5.1
The definition of 'HTMLFormElement.reportValidity()' in that specification.
Working Draft Initial definition

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 40.0 No support No support (Yes) No support
Feature Android Android Webview Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support ? 40.0 ? ? ? ? 40.0

Etiquetas y colaboradores del documento

 Colaboradores en esta página: Alexander_, claudepache, jpmedley, cvrebert, Sebastianz, IncSW, teoli, kscarfone
 Última actualización por: Alexander_,