luci-base: cbi.js: support field validation for formless inputs
authorJo-Philipp Wich <jo@mein.io>
Tue, 5 Feb 2019 12:21:33 +0000 (13:21 +0100)
committerJo-Philipp Wich <jo@mein.io>
Sun, 7 Jul 2019 13:25:49 +0000 (15:25 +0200)
JS CBI fields have no parent form element anymore.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/cbi.js

index 94686e13d200978860333fe49316f33ffdb65d48..3131ccbaa54d97334d4cddadeb6c0a23ae42a202 100644 (file)
@@ -260,7 +260,7 @@ var CBIValidatorPrototype = {
 
        validate: function() {
                /* element is detached */
-               if (!findParent(this.field, 'form'))
+               if (!findParent(this.field, 'body'))
                        return true;
 
                this.field.classList.remove('cbi-input-invalid');