From: Jo-Philipp Wich Date: Tue, 5 Feb 2019 12:21:33 +0000 (+0100) Subject: luci-base: cbi.js: support field validation for formless inputs X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4a9f784a2a075ecb96a7e45d6a60160038f968a9;p=oweals%2Fluci.git luci-base: cbi.js: support field validation for formless inputs JS CBI fields have no parent form element anymore. Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 94686e13d..3131ccbaa 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -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');