From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../api/htmlformelement/reportvalidity/index.html | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 files/fr/web/api/htmlformelement/reportvalidity/index.html (limited to 'files/fr/web/api/htmlformelement/reportvalidity') diff --git a/files/fr/web/api/htmlformelement/reportvalidity/index.html b/files/fr/web/api/htmlformelement/reportvalidity/index.html new file mode 100644 index 0000000000..ea685b944c --- /dev/null +++ b/files/fr/web/api/htmlformelement/reportvalidity/index.html @@ -0,0 +1,60 @@ +--- +title: HTMLFormElement.reportValidity() +slug: Web/API/HTMLFormElement/reportValidity +tags: + - HTML + - Méthode +translation_of: Web/API/HTMLFormElement/reportValidity +--- +
{{APIRef("HTML DOM")}}
+ +

La méthode  HTMLFormElement.reportValidity() renvoie true si les contrôles enfants de l'élément répondent à leurs contraintes de validation. Lorsque la valeur false est renvoyée,les événements invalid annulables sont déclenchés pour chaque enfant non valide et les problèmes de validation sont signalés à l'utilisateur. .

+ +

Syntax

+ +
HTMLFormElement.reportValidity()
+
+ +

Valeur de retour

+ +

{{domxref("Boolean")}}

+ +

Exemple

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

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusCommentaire
{{SpecName("HTML WHATWG", "forms.html#dom-cva-reportvalidity", "HTMLFormElement.reportValidity()")}}{{Spec2("HTML WHATWG")}} 
{{SpecName("HTML5.1", "semantics.html#the-constraint-validation-api", "HTMLFormElement.reportValidity()")}}{{Spec2("HTML5.1")}}Définition initiale
+ +

Compatibilité du navigateur

+ + + +

{{Compat("api.HTMLFormElement.reportValidity")}}

-- cgit v1.2.3-54-g00ecf