summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2006-11-25 21:13:03 +0000
committerxue <>2006-11-25 21:13:03 +0000
commitcbe377adc3285cebc83a4980027b47bdc1c4a8a5 (patch)
tree698319b8531d6cd0c1701ee4f4176d655beebd68
parentab13651952c7ce3a5048e5b7d2f2d62d61a71de8 (diff)
Fixed #460.
-rw-r--r--HISTORY3
-rw-r--r--framework/Web/UI/WebControls/TBaseValidator.php24
2 files changed, 15 insertions, 12 deletions
diff --git a/HISTORY b/HISTORY
index 0b6bc7dd..7743786f 100644
--- a/HISTORY
+++ b/HISTORY
@@ -4,7 +4,8 @@ BUG: Ticket#442 - TPageService getBasePath in namespace form (Qiang)
BUG: TTableCell should render &nbsp; only when Text is not set and there's no child (Qiang)
ENH: Ticket#446 - Added TMetaTagCollection.getMetaTagByID method (Qiang)
CHG: Ticket#437 - __autoload is replaced by spl_autoload_register (Qiang)
-CHG: Ticket#454 - Redundant PHP Version Check
+CHG: Ticket#454 - Redundant PHP Version Check (Qiang)
+CHG: Ticket#460 - Validators will not perform validation if parents are disabled (Qiang)
CHG: TRepeater does not render <span> anymore for empty item template (Qiang)
CHG: THttpRequest.constructUrl() now encodes ampersand by default (Qiang)
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php
index db0c9f02..621f15bc 100644
--- a/framework/Web/UI/WebControls/TBaseValidator.php
+++ b/framework/Web/UI/WebControls/TBaseValidator.php
@@ -482,20 +482,22 @@ abstract class TBaseValidator extends TLabel implements IValidator
*/
public function validate()
{
- if($visible=$this->getVisible(true))
- $this->onValidate();
$this->setIsValid(true);
- if($this->getValidationTarget() && $visible && $this->getEnabled())
+ if($this->getVisible(true) && $this->getEnabled(true))
{
- if($this->evaluateIsValid())
- {
- $this->setIsValid(true);
- $this->onSuccess();
- }
- else
+ $this->onValidate();
+ if($this->getValidationTarget())
{
- $this->setIsValid(false);
- $this->onError();
+ if($this->evaluateIsValid())
+ {
+ $this->setIsValid(true);
+ $this->onSuccess();
+ }
+ else
+ {
+ $this->setIsValid(false);
+ $this->onError();
+ }
}
}
return $this->getIsValid();