X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fcbi%2Fhtdocs%2Fluci-static%2Fresources%2Fcbi.js;h=247228d225b47d6a3f15a88e3ecefae176153be7;hp=24f929c9bc48ff000f1b4eb2dbac9363439e495a;hb=bddc2053b4d020a1982c8bfb86dde5a88dc47be6;hpb=7c0ea176236eb4232303fbc60aabb2e0448a169f diff --git a/libs/cbi/htdocs/luci-static/resources/cbi.js b/libs/cbi/htdocs/luci-static/resources/cbi.js index 24f929c9b..247228d22 100644 --- a/libs/cbi/htdocs/luci-static/resources/cbi.js +++ b/libs/cbi/htdocs/luci-static/resources/cbi.js @@ -15,6 +15,7 @@ var cbi_d = []; var cbi_t = []; +var cbi_c = []; function cbi_d_add(field, dep, next) { var obj = document.getElementById(field); @@ -44,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; @@ -58,15 +70,26 @@ function cbi_d_checkvalue(target, ref) { } function cbi_d_check(deps) { + var reverse; + var def = false; for (var i=0; i