From fb12ade1617d23f5c01c26ac01a5e8e3659a7b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C5=A0uvakin?= Date: Sun, 20 Mar 2022 12:33:08 +0100 Subject: [PATCH] disable validation for 'novalidate' attribute --- nette.ajax.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nette.ajax.js b/nette.ajax.js index 94cc8f7..c00ea79 100755 --- a/nette.ajax.js +++ b/nette.ajax.js @@ -316,7 +316,9 @@ $.nette.ext('validation', { analyze.form.get(0)["nette-submittedBy"] = analyze.el.get(0); } var notValid; - if ((typeof Nette.version === 'undefined' || Nette.version == '2.3')) { // Nette 2.3 and older + if (analyze.form.get(0).getAttribute('novalidate') === 'novalidate') { + notValid = false; + } else if ((typeof Nette.version === 'undefined' || Nette.version == '2.3')) { // Nette 2.3 and older var ie = this.ie(); notValid = (analyze.form.get(0).onsubmit && analyze.form.get(0).onsubmit((typeof ie !== 'undefined' && ie < 9) ? undefined : e) === false); } else { // Nette 2.4 and up