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 <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2019-02-05 13:21:33 +01:00
parent 6b8701c7bf
commit 4a9f784a2a

View 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');