diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-04-27 00:27:37 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-04-27 00:27:37 +0000 |
commit | eca5a0abf07d6c4a08278bec9c578bdf294929c8 (patch) | |
tree | dfdef68956dbe3b84e281fc4afa19837aeec16ad /libs/cbi/htdocs | |
parent | c4ac5b8eb86782b2fc8f16678b341c5f95f3f189 (diff) |
libs/cbi:
- skip client side field validation if corrsponding field was removed due to dependencies
- human readable error strings in uci section summary
- implement field validation for dnyamic lists
- render optional fields when section has tabs
Diffstat (limited to 'libs/cbi/htdocs')
-rw-r--r-- | libs/cbi/htdocs/luci-static/resources/cbi.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/libs/cbi/htdocs/luci-static/resources/cbi.js b/libs/cbi/htdocs/luci-static/resources/cbi.js index 7cdca642d2..4af6e58d9b 100644 --- a/libs/cbi/htdocs/luci-static/resources/cbi.js +++ b/libs/cbi/htdocs/luci-static/resources/cbi.js @@ -488,15 +488,19 @@ function cbi_validate_field(cbid, optional, type) { var validator = function(reset) { - field.className = field.className.replace(/ cbi-input-invalid/g, ''); - - // validate value - var value = (field.options) ? field.options[field.options.selectedIndex].value : field.value; - if( !(((value.length == 0) && optional) || vldcb(value)) ) + // is not detached + if( field.form ) { - // invalid - field.className += ' cbi-input-invalid'; - return false; + field.className = field.className.replace(/ cbi-input-invalid/g, ''); + + // validate value + var value = (field.options) ? field.options[field.options.selectedIndex].value : field.value; + if( !(((value.length == 0) && optional) || vldcb(value)) ) + { + // invalid + field.className += ' cbi-input-invalid'; + return false; + } } return true; |