summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected
diff options
context:
space:
mode:
authorxue <>2006-01-16 15:36:15 +0000
committerxue <>2006-01-16 15:36:15 +0000
commit318ca1a7cc0085f36a6ca6648b6b2a7eb2bab295 (patch)
tree27f6a127aea9c41851c9eaa07fb0d3f495b64033 /demos/quickstart/protected
parent14a4d3010ab626c3d333606daeb5012d0804c1dd (diff)
Added customvalidator demo.
Diffstat (limited to 'demos/quickstart/protected')
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.page70
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.php12
2 files changed, 82 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
new file mode 100644
index 00000000..840a6550
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.page
@@ -0,0 +1,70 @@
+<com:TContent ID="body">
+
+<script type="text/javascript"><!--
+function myValidationFunction(sender, parameter)
+{
+ if(parameter == 'test')
+ return true;
+ else
+ return false;
+}
+--></script>
+
+<h1>TCustomValidator Samples</h1>
+
+<table class="sampletable">
+
+<tr>
+<td class="samplenote">
+Custom validator with default settings:
+</td>
+<td class="sampleaction">
+<com:TTextBox ID="TextBox1" />
+<com:TCustomValidator
+ ValidationGroup="Group1"
+ ControlToValidate="TextBox1"
+ ClientValidationFunction="myValidationFunction"
+ ServerValidate="serverValidate"
+ Text="You must enter 'test'." />
+<com:TButton Text="Submit" ValidationGroup="Group1" />
+</td>
+</tr>
+
+<tr>
+<td class="samplenote">
+Custom validator with client-side validation disabled:
+</td>
+<td class="sampleaction">
+<com:TTextBox ID="TextBox2" />
+<com:TCustomValidator
+ ValidationGroup="Group2"
+ EnableClientScript="false"
+ ControlToValidate="TextBox2"
+ ClientValidationFunction="myValidationFunction"
+ ServerValidate="serverValidate"
+ Text="You must enter 'test'." />
+<com:TButton Text="Submit" ValidationGroup="Group2" />
+</td>
+</tr>
+
+<tr>
+<td class="samplenote">
+Custom validator with focus-on-error enabled and dynamic display:
+</td>
+<td class="sampleaction">
+<com:TTextBox ID="TextBox3" />
+<com:TCustomValidator
+ ValidationGroup="Group3"
+ ControlToValidate="TextBox3"
+ ClientValidationFunction="myValidationFunction"
+ ServerValidate="serverValidate"
+ FocusOnError="true"
+ Text="You must enter 'test'." />
+<com:TButton Text="Submit" ValidationGroup="Group3" />
+</td>
+</tr>
+
+
+</table>
+
+</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.php
new file mode 100644
index 00000000..0db261b9
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.php
@@ -0,0 +1,12 @@
+<?php
+
+class Home extends TPage
+{
+ public function serverValidate($sender,$param)
+ {
+ if($param->Value!=='test')
+ $param->IsValid=false;
+ }
+}
+
+?> \ No newline at end of file