summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi/htdocs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-04-26 00:00:33 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-04-26 00:00:33 +0000
commit8e590d6650351a0d138b9dd6b7f06bd8e912c330 (patch)
treee01f9d37c4f1c1a03041fcb0d75eec960b65a601 /libs/cbi/htdocs
parentdcf53bd886f6a0ee34c02d4ed9d7b6cc85904a5c (diff)
libs/cbi: always reset class name in validation handler
Diffstat (limited to 'libs/cbi/htdocs')
-rw-r--r--libs/cbi/htdocs/luci-static/resources/cbi.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/cbi/htdocs/luci-static/resources/cbi.js b/libs/cbi/htdocs/luci-static/resources/cbi.js
index 200016d6e6..3840456ca4 100644
--- a/libs/cbi/htdocs/luci-static/resources/cbi.js
+++ b/libs/cbi/htdocs/luci-static/resources/cbi.js
@@ -461,6 +461,8 @@ function cbi_validate_disable_form(form, onoff)
function cbi_validate_field(type, optional, field)
{
+ field.className = field.className.replace(/ cbi-input-invalid/g, '');
+
var vldcb = cbi_validators[type];
if( vldcb )
{
@@ -469,7 +471,6 @@ function cbi_validate_field(type, optional, field)
if( ((value.length == 0) && optional) || vldcb(value) )
{
// OK
- field.className = field.className.replace(/ cbi-input-invalid/g, '');
cbi_validate_disable_form(field.form, false);
}
else
@@ -482,7 +483,6 @@ function cbi_validate_field(type, optional, field)
else
{
// OK
- field.className = field.className.replace(/ cbi-input-invalid/g, '');
cbi_validate_disable_form(field.form, false);
}
}