summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/Samples
diff options
context:
space:
mode:
authorxue <>2006-02-22 02:46:25 +0000
committerxue <>2006-02-22 02:46:25 +0000
commitfceb3741d3b0c1e00e81a4a24caf7d49a86896b4 (patch)
treeb2d7f92eaacc92111701c493b91da9d882f580be /demos/quickstart/protected/pages/Controls/Samples
parent0922e304fb1d7fc2e486d7020e65e011b9f13e0d (diff)
Updated some validators and relevant demos.
Diffstat (limited to 'demos/quickstart/protected/pages/Controls/Samples')
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TEmailAddressValidator/Home.page3
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TRegularExpressionValidator/Home.page21
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TRequiredFieldValidator/Home.page74
3 files changed, 85 insertions, 13 deletions
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TEmailAddressValidator/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TEmailAddressValidator/Home.page
index db63a0a9..79066e44 100644
--- a/demos/quickstart/protected/pages/Controls/Samples/TEmailAddressValidator/Home.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/TEmailAddressValidator/Home.page
@@ -1,7 +1,7 @@
<com:TContent ID="body">
<h1>TEmailAddressValidator Samples</h1>
-<p><strong>Note:</strong>TEmailAddressValidator will start
+<p><strong>Note:</strong> TEmailAddressValidator will start
to validate only if the input is not empty.</p>
<table class="sampletable">
@@ -44,6 +44,7 @@ Email address validator with focus-on-error enabled and dynamic display:
<com:TEmailAddressValidator
ValidationGroup="Group3"
ControlToValidate="TextBox3"
+ FocusOnError="true"
Display="Dynamic"
Text="Invalid email address." />
<com:TButton Text="Submit" ValidationGroup="Group3" />
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRegularExpressionValidator/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TRegularExpressionValidator/Home.page
index 5ce43fda..9c27057b 100644
--- a/demos/quickstart/protected/pages/Controls/Samples/TRegularExpressionValidator/Home.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/TRegularExpressionValidator/Home.page
@@ -1,8 +1,11 @@
<com:TContent ID="body">
<h1>TRegularExpressionValidator Samples</h1>
-<p><strong>Note:</strong>TRegularExpressionValidator will start
-to validate only if the input is not empty.</p>
+<p>
+<strong>Note:</strong> TRegularExpressionValidator will start
+to validate only if the input is not empty.
+</p>
+
<table class="sampletable">
<tr>
@@ -10,12 +13,12 @@ to validate only if the input is not empty.</p>
Regular expression validator with default settings:
</td>
<td class="sampleaction">
-<com:TTextBox ID="TextBox1" Text="a"/>
+<com:TTextBox ID="TextBox1" Text="xxx-xx-xxxx"/>
<com:TRegularExpressionValidator
ValidationGroup="Group1"
ControlToValidate="TextBox1"
- RegularExpression="\d+"
- Text="Only digits are allowed." />
+ RegularExpression="\d{3}-\d{2}-\d{4}"
+ Text="SSN must be in the format of xxx-xx-xxxx." />
<com:TButton Text="Submit" ValidationGroup="Group1" />
</td>
</tr>
@@ -30,8 +33,8 @@ Regular expression validator with client-side validation disabled:
ValidationGroup="Group2"
EnableClientScript="false"
ControlToValidate="TextBox2"
- RegularExpression="\d+"
- Text="Only digits are allowed." />
+ RegularExpression="[\w]{6,}"
+ Text="Input must consist of at least 6 characters." />
<com:TButton Text="Submit" ValidationGroup="Group2" />
</td>
</tr>
@@ -46,8 +49,8 @@ Regular expression validator with focus-on-error enabled and dynamic display:
ValidationGroup="Group3"
ControlToValidate="TextBox3"
Display="Dynamic"
- RegularExpression="\d+"
- Text="Only digits are allowed." />
+ RegularExpression="\d{5}(-\d{4})?"
+ Text="Invalid US ZIP code." />
<com:TButton Text="Submit" ValidationGroup="Group3" />
</td>
</tr>
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRequiredFieldValidator/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TRequiredFieldValidator/Home.page
index 36d02ced..e5c27cd0 100644
--- a/demos/quickstart/protected/pages/Controls/Samples/TRequiredFieldValidator/Home.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/TRequiredFieldValidator/Home.page
@@ -6,7 +6,7 @@
<tr>
<td class="samplenote">
-Required field validator with default settings:
+Validator with default settings:
</td>
<td class="sampleaction">
<com:TTextBox ID="TextBox1" />
@@ -20,7 +20,7 @@ Required field validator with default settings:
<tr>
<td class="samplenote">
-Required field validator with client-side validation disabled:
+Validator with client-side validation disabled:
</td>
<td class="sampleaction">
<com:TTextBox ID="TextBox2" />
@@ -35,12 +35,13 @@ Required field validator with client-side validation disabled:
<tr>
<td class="samplenote">
-Required field validator with focus-on-error enabled and dynamic display:
+Validator with focus-on-error enabled and dynamic display:
</td>
<td class="sampleaction">
<com:TTextBox ID="TextBox3" />
<com:TRequiredFieldValidator
ValidationGroup="Group3"
+ Display="Dynamic"
ControlToValidate="TextBox3"
FocusOnError="true"
Text="Field required." />
@@ -48,6 +49,73 @@ Required field validator with focus-on-error enabled and dynamic display:
</td>
</tr>
+<tr>
+<td class="samplenote">
+Validating if initial value (test) is changed:
+</td>
+<td class="sampleaction">
+<com:TTextBox ID="TextBox4" Text="test" />
+<com:TRequiredFieldValidator
+ ValidationGroup="Group4"
+ Display="Dynamic"
+ ControlToValidate="TextBox4"
+ InitialValue="test"
+ Text="Input must not be 'test'." />
+<com:TButton Text="Submit" ValidationGroup="Group4" />
+</td>
+</tr>
+
+<tr>
+<td class="samplenote">
+Validating if checkbox is checked:
+</td>
+<td class="sampleaction">
+<com:TCheckBox ID="CheckBox" Text="agree" />
+<com:TRequiredFieldValidator
+ ValidationGroup="Group5"
+ Display="Dynamic"
+ ControlToValidate="CheckBox"
+ Text="You must agree." />
+<com:TButton Text="Submit" ValidationGroup="Group5" />
+</td>
+</tr>
+
+<tr>
+<td class="samplenote">
+Validating if a selection has been made in a dropdown list:
+</td>
+<td class="sampleaction">
+<com:TDropDownList ID="DropDownList">
+ <com:TListItem Value="value 1" Text="text 1" Selected="true" />
+ <com:TListItem Value="value 2" Text="text 2" />
+ <com:TListItem Value="value 3" Text="text 3" />
+</com:TDropDownList>
+<com:TRequiredFieldValidator
+ ValidationGroup="Group6"
+ ControlToValidate="DropDownList"
+ InitialValue="value 1"
+ Text="A selection must be made." />
+<com:TButton Text="Submit" ValidationGroup="Group6" />
+</td>
+</tr>
+
+<tr>
+<td class="samplenote">
+Validating if a selection has been made in a dropdown list:
+</td>
+<td class="sampleaction">
+<com:TListBox ID="ListBox">
+ <com:TListItem Value="value 1" Text="text 1" />
+ <com:TListItem Value="value 2" Text="text 2" />
+ <com:TListItem Value="value 3" Text="text 3" />
+</com:TListBox>
+<com:TRequiredFieldValidator
+ ValidationGroup="Group7"
+ ControlToValidate="ListBox"
+ Text="A selection must be made." />
+<com:TButton Text="Submit" ValidationGroup="Group7" />
+</td>
+</tr>
</table>