summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
Diffstat (limited to 'framework')
-rw-r--r--framework/Web/Javascripts/source/prado/validator/validation3.js11
-rw-r--r--framework/Web/UI/WebControls/TBaseValidator.php11
2 files changed, 20 insertions, 2 deletions
diff --git a/framework/Web/Javascripts/source/prado/validator/validation3.js b/framework/Web/Javascripts/source/prado/validator/validation3.js
index 47c031c4..290b6f62 100644
--- a/framework/Web/Javascripts/source/prado/validator/validation3.js
+++ b/framework/Web/Javascripts/source/prado/validator/validation3.js
@@ -667,9 +667,18 @@ Prado.WebUI.TBaseValidator.prototype =
if(typeof(CssClass) == "string" && CssClass.length > 0)
{
if(valid)
- control.removeClassName(CssClass);
+ {
+ if (control.lastValidator == this.options.ID)
+ {
+ control.lastValidator = null;
+ control.removeClassName(CssClass);
+ }
+ }
else
+ {
+ control.lastValidator = this.options.ID;
control.addClassName(CssClass);
+ }
}
},
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php
index 96aefe63..59b4fc16 100644
--- a/framework/Web/UI/WebControls/TBaseValidator.php
+++ b/framework/Web/UI/WebControls/TBaseValidator.php
@@ -243,10 +243,19 @@ abstract class TBaseValidator extends TLabel implements IValidator
}
if($this->getEnableClientScript() & $this->getEnabled(true))
$this->registerClientScriptValidator();
- $this->updateControlCssClass();
}
/**
+ * Override parent implementation to update the control CSS Class before
+ * the validated control is rendered
+ */
+ public function onPreRender ($param)
+ {
+ parent::onPreRender($param);
+ $this->updateControlCssClass();
+ }
+
+ /**
* Update the ControlToValidate component's css class depending
* if the ControlCssClass property is set, and whether this is valid.
* @return boolean true if change, false otherwise.