public function validate()
{
$this->onValidate();
if ($this->getVisible(true) && $this->getEnabled(true)) {
$target = $this->getValidationTarget();
// if the target is not a disabled web control
if ($target === null || $target !== null && !($target instanceof TWebControl && !$target->getEnabled(true))) {
if ($this->evaluateIsValid()) {
$this->setIsValid(true);
$this->onValidationSuccess();
} else {
if ($target) {
$target->setIsValid(false);
}
$this->setIsValid(false);
$this->onValidationError();
}
} else {
$this->evaluateIsValid();
$this->setIsValid(true);
$this->onValidationSuccess();
}
} else {
$this->setIsValid(true);
}
return $this->getIsValid();
}