diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-11-26 00:24:59 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-11-26 00:24:59 +0000 |
commit | bddc2053b4d020a1982c8bfb86dde5a88dc47be6 (patch) | |
tree | c65d0d85991e1991eee179ff3b85e303f17a7849 /libs | |
parent | 46fea6f6ccfa6fc37e434fd5f092bf0bd8ece483 (diff) |
libs/cbi: fix dependency handling of radio buttons
Diffstat (limited to 'libs')
-rw-r--r-- | libs/cbi/htdocs/luci-static/resources/cbi.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libs/cbi/htdocs/luci-static/resources/cbi.js b/libs/cbi/htdocs/luci-static/resources/cbi.js index bbea0f37d..247228d22 100644 --- a/libs/cbi/htdocs/luci-static/resources/cbi.js +++ b/libs/cbi/htdocs/luci-static/resources/cbi.js @@ -45,7 +45,18 @@ function cbi_d_checkvalue(target, ref) { var t = document.getElementById(target); var value; - if (!t || !t.value) { + if (!t) { + var tl = document.getElementsByName(target); + + if( tl.length > 0 && tl[0].type == 'radio' ) + for( var i = 0; i < tl.length; i++ ) + if( tl[i].checked ) { + value = tl[i].value; + break; + } + + value = value ? value : ""; + } else if (!t.value) { value = ""; } else { value = t.value; |