diff options
author | Steven Barth <steven@midlink.org> | 2008-09-17 12:06:05 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-09-17 12:06:05 +0000 |
commit | 309a448a1fa0489aa25bdfe639156326835e7ba1 (patch) | |
tree | cff8c223ed8c0c74b80e30f7f6ab04b43047eb33 /libs/cbi/htdocs | |
parent | f1637e655073c2403a6a110ea6fe83332656039f (diff) |
Don't validate dependencies for fields which are not part of the form
Diffstat (limited to 'libs/cbi/htdocs')
-rw-r--r-- | libs/cbi/htdocs/luci-static/resources/cbi.js | 10 |
1 files changed, 6 insertions, 4 deletions
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<deps.length; i++) { var istat = true for (var j in deps[i]) { - istat = (istat && cbi_d_value(j) == deps[i][j]) + istat = (istat && cbi_d_checkvalue(j, deps[i][j])) } if (istat) { return true |