From: Steven Barth Date: Wed, 17 Sep 2008 12:07:09 +0000 (+0000) Subject: Don't validate dependencies for fields which are not part of the form X-Git-Tag: 0.8.0~62 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3915eb48aea849a3c1e58517d5eb55332216a439;p=oweals%2Fluci.git Don't validate dependencies for fields which are not part of the form --- diff --git a/libs/cbi/htdocs/luci-static/resources/cbi.js b/libs/cbi/htdocs/luci-static/resources/cbi.js index f70818e16..33a328cff 100644 --- a/libs/cbi/htdocs/luci-static/resources/cbi.js +++ b/libs/cbi/htdocs/luci-static/resources/cbi.js @@ -24,11 +24,13 @@ function cbi_d_add(field, dep, next) { } } -function cbi_d_value(target) { +function cbi_d_checkvalue(target, ref) { var t = document.getElementById(target); var value - if (!t || !t.value) { + if (!t) { + return true + } else if (!t.value) { value = ""; } else { value = t.value; @@ -38,14 +40,14 @@ function cbi_d_value(target) { } } - return value + return (value == ref) } function cbi_d_check(deps) { for (var i=0; i