diff options
author | tof <> | 2008-04-08 14:48:48 +0000 |
---|---|---|
committer | tof <> | 2008-04-08 14:48:48 +0000 |
commit | 24f10e736df7705dbbff76d2f3345eaba369f432 (patch) | |
tree | dd76ba60da719d71aa2a80340fc0ad9961540d5a /framework | |
parent | b43c8b4c9f3973eb5482298ed8283e33c1f426e1 (diff) |
Fixed #595
Diffstat (limited to 'framework')
-rw-r--r-- | framework/Web/Javascripts/source/prado/validator/validation3.js | 11 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TBaseValidator.php | 11 |
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. |