summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls
diff options
context:
space:
mode:
Diffstat (limited to 'demos/quickstart/protected/pages/Controls')
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.page13
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.php6
2 files changed, 19 insertions, 0 deletions
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.page
index 7c1bccfe..65195a55 100644
--- a/demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.page
@@ -64,6 +64,19 @@ Custom validator with focus-on-error enabled and dynamic display:
</td>
</tr>
+<tr>
+<td class="samplenote">
+Custom validator without ControlToValidate:
+</td>
+<td class="sampleaction">
+<com:TTextBox ID="TextBox4" />
+<com:TCustomValidator
+ ValidationGroup="Group4"
+ OnServerValidate="serverValidateNoControl"
+ Text="You must enter 'test'." />
+<com:TButton Text="Submit" ValidationGroup="Group4" />
+</td>
+</tr>
</table>
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.php
index 0db261b9..da0d15b2 100644
--- a/demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.php
+++ b/demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.php
@@ -7,6 +7,12 @@ class Home extends TPage
if($param->Value!=='test')
$param->IsValid=false;
}
+
+ public function serverValidateNoControl($sender,$param)
+ {
+ if($this->TextBox4->Text!=='test')
+ $param->IsValid=false;
+ }
}
?> \ No newline at end of file