diff options
author | xue <> | 2006-07-21 15:31:21 +0000 |
---|---|---|
committer | xue <> | 2006-07-21 15:31:21 +0000 |
commit | b0744e3ffc412d4f8f706f8e75242509798bf21d (patch) | |
tree | 4af330bd387518463b18eeca0b90ccab8be33f36 /framework/Web/UI/WebControls/TBaseValidator.php | |
parent | a09f20e18289796f73ab795febc9dff542797ba1 (diff) |
fixed #206.
Diffstat (limited to 'framework/Web/UI/WebControls/TBaseValidator.php')
-rw-r--r-- | framework/Web/UI/WebControls/TBaseValidator.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php index 9b181a2a..b2405996 100644 --- a/framework/Web/UI/WebControls/TBaseValidator.php +++ b/framework/Web/UI/WebControls/TBaseValidator.php @@ -478,10 +478,10 @@ abstract class TBaseValidator extends TLabel implements IValidator */ public function validate() { - $this->onValidate(); + if($visible=$this->getVisible(true)) + $this->onValidate(); $this->setIsValid(true); - $control=$this->getValidationTarget(); - if($control && $this->getVisible(true) && $this->getEnabled()) + if($this->getValidationTarget() && $visible && $this->getEnabled()) { if($this->evaluateIsValid()) { @@ -538,6 +538,9 @@ abstract class TBaseValidator extends TLabel implements IValidator /** * This event is raised right before the validator starts to perform validation. + * You may use this event to change the behavior of validation. + * For example, you may disable the validator if certain condition is satisfied. + * Note, the event will NOT be raised if the validator is invisible. */ public function onValidate() { |