summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TButton.php
diff options
context:
space:
mode:
authorwei <>2006-01-09 04:39:05 +0000
committerwei <>2006-01-09 04:39:05 +0000
commit9f2ecd591d5be41bb9dc7b8a0fa144ac35a173bb (patch)
tree122d77d166d5df687d524173b883d87fd6674c0d /framework/Web/UI/WebControls/TButton.php
parent9c9a2d731fea9679f65904a3a6b72dd78b4253a4 (diff)
TRequiredFieldValidator works now. See FunctionalTests/index.php in your browser.
Diffstat (limited to 'framework/Web/UI/WebControls/TButton.php')
-rw-r--r--framework/Web/UI/WebControls/TButton.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/framework/Web/UI/WebControls/TButton.php b/framework/Web/UI/WebControls/TButton.php
index 7109bca4..e03bc676 100644
--- a/framework/Web/UI/WebControls/TButton.php
+++ b/framework/Web/UI/WebControls/TButton.php
@@ -75,11 +75,15 @@ class TButton extends TWebControl implements IPostBackEventHandler
$writer->addAttribute('name',$uniqueID);
$writer->addAttribute('value',$this->getText());
if($this->getEnabled(true))
- {
+ {
$scripts = $this->getPage()->getClientScript();
- $options = $this->getPostBackOptions();
- $postback = $scripts->getPostBackEventReference($this, '', $options, false);
- $scripts->registerClientEvent($this, "click", $postback);
+ if($scripts->isEndScriptRegistered("TBaseValidator"))
+ {
+ $group = $this->getValidationGroup();
+ $group = strlen($group) ? ",'".$group."'" : '';
+ $script = "Prado.Validation.AddTarget('{$uniqueID}'{$group});";
+ $scripts->registerEndScript("{$uniqueID}:target", $script);
+ }
}
else if($this->getEnabled()) // in this case, parent will not render 'disabled'
$writer->addAttribute('disabled','disabled');