diff options
author | xue <> | 2006-02-22 05:09:29 +0000 |
---|---|---|
committer | xue <> | 2006-02-22 05:09:29 +0000 |
commit | d7c8a56d49200cb46d94403934674d670035ff20 (patch) | |
tree | 94f2b9370333afd15db61916e0b4c6e0049507c9 /demos/quickstart/protected/pages | |
parent | a5c9d537393a949f5b2d9469505890fa508b92ab (diff) |
cleanup of validators.
Diffstat (limited to 'demos/quickstart/protected/pages')
-rw-r--r-- | demos/quickstart/protected/pages/Controls/Samples/LabeledTextBox1/Home.php | 2 | ||||
-rw-r--r-- | demos/quickstart/protected/pages/Controls/Validation.page | 33 |
2 files changed, 32 insertions, 3 deletions
diff --git a/demos/quickstart/protected/pages/Controls/Samples/LabeledTextBox1/Home.php b/demos/quickstart/protected/pages/Controls/Samples/LabeledTextBox1/Home.php index 2b18972d..2309bd88 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/LabeledTextBox1/Home.php +++ b/demos/quickstart/protected/pages/Controls/Samples/LabeledTextBox1/Home.php @@ -1,6 +1,6 @@ <?php
-Prado::using('Application.pages.Controls.Samples.LabeledTextBox2.LabeledTextBox');
+Prado::using('Application.pages.Controls.Samples.LabeledTextBox1.LabeledTextBox');
class Home extends TPage
{
diff --git a/demos/quickstart/protected/pages/Controls/Validation.page b/demos/quickstart/protected/pages/Controls/Validation.page index fe801183..766925ca 100644 --- a/demos/quickstart/protected/pages/Controls/Validation.page +++ b/demos/quickstart/protected/pages/Controls/Validation.page @@ -129,17 +129,46 @@ Note, if the value being validated is empty, TEmailAddressValidator will not do <h2>TRangeValidator</h2>
<p>
+TRangeValidator tests whether an input value is within a specified range.
</p>
+<p>
+TRangeValidator uses three key properties to perform its validation. The <tt>MinValue</tt> and <tt>MaxValue</tt> properties specify the minimum and maximum values of the valid range. The <tt>ValueType</tt> property specifies the data type of the value being validated. The value will be first converted into the specified type and then compare with the valid range. The following value types are supported:
+</p>
+<ul>
+<li><tt>String</tt> - A string data type.</li>
+<li><tt>Integer</tt> - A 32-bit signed integer data type.</li>
+<li><tt>Float</tt> - A double-precision floating point number data type.</li>
+<li><tt>Currency</tt> - A decimal data type that can contain currency symbols.</li>
+<li><tt>Date</tt> - A date data type. The date format can be specified by setting <tt>DateFormat</tt> property, which must be recognizable by <tt>TSimpleDateFormatter</tt>. If the property is not set, the GNU date syntax is assumed.</li>
+</ul>
<com:RunBar PagePath="Controls.Samples.TRangeValidator.Home" />
-<h2>TValueTypeValidator</h2>
+<h2>TDataTypeValidator</h2>
<p>
</p>
-<com:RunBar PagePath="Controls.Samples.TValueTypeValidator.Home" />
+<com:RunBar PagePath="Controls.Samples.TDataTypeValidator.Home" />
<h2>TCustomValidator</h2>
<p>
+TCustomValidator performs user-defined validation (either server-side or client-side or both) on an input control.
+</p>
+<p>
+To create a server-side validation function, provide a handler for the <tt>OnServerValidate</tt> event that performs the validation. The data string of the input control to validate can be accessed by the event parameter's <tt>Value</tt> property. The result of the validation should be stored in the <tt>IsValid</tt> property of the parameter.
+</p>
+<p>
+To create a client-side validation function, add the client-side validation javascript function to the page template and assign its name to the <tt>ClientValidationFunction</tt> property. The function should have the following signature:
</p>
+<com:TTextHighlighter Language="javascript" CssClass="source">
+<script type="text/javascript">
+function ValidationFunctionName(sender, parameter)
+{
+ // if(parameter == ...)
+ // return true;
+ // else
+ // return false;
+}
+</script>
+</com:TTextHighlighter>
<com:RunBar PagePath="Controls.Samples.TCustomValidator.Home" />
|