| 1 |
lars |
1 |
<com:TContent ID="body">
|
|
|
2 |
|
|
|
3 |
<h1>TRegularExpressionValidator Samples</h1>
|
|
|
4 |
<p>
|
|
|
5 |
<strong>Note:</strong> TRegularExpressionValidator will start
|
|
|
6 |
to validate only if the input is not empty.
|
|
|
7 |
</p>
|
|
|
8 |
|
|
|
9 |
<table class="sampletable">
|
|
|
10 |
|
|
|
11 |
<tr>
|
|
|
12 |
<td class="samplenote">
|
|
|
13 |
Regular expression validator with default settings:
|
|
|
14 |
</td>
|
|
|
15 |
<td class="sampleaction">
|
|
|
16 |
<com:TTextBox ID="TextBox1" Text="xxx-xx-xxxx"/>
|
|
|
17 |
<com:TRegularExpressionValidator
|
|
|
18 |
ValidationGroup="Group1"
|
|
|
19 |
ControlToValidate="TextBox1"
|
|
|
20 |
RegularExpression="\d{3}-\d{2}-\d{4}"
|
|
|
21 |
Text="SSN must be in the format of xxx-xx-xxxx." />
|
|
|
22 |
<com:TButton Text="Submit" ValidationGroup="Group1" />
|
|
|
23 |
</td>
|
|
|
24 |
</tr>
|
|
|
25 |
|
|
|
26 |
<tr>
|
|
|
27 |
<td class="samplenote">
|
|
|
28 |
Regular expression validator with client-side validation disabled:
|
|
|
29 |
</td>
|
|
|
30 |
<td class="sampleaction">
|
|
|
31 |
<com:TTextBox ID="TextBox2" Text="b"/>
|
|
|
32 |
<com:TRegularExpressionValidator
|
|
|
33 |
ValidationGroup="Group2"
|
|
|
34 |
EnableClientScript="false"
|
|
|
35 |
ControlToValidate="TextBox2"
|
|
|
36 |
RegularExpression="[\w]{6,}"
|
|
|
37 |
Text="Input must consist of at least 6 characters." />
|
|
|
38 |
<com:TButton Text="Submit" ValidationGroup="Group2" />
|
|
|
39 |
</td>
|
|
|
40 |
</tr>
|
|
|
41 |
|
|
|
42 |
<tr>
|
|
|
43 |
<td class="samplenote">
|
|
|
44 |
Regular expression validator with focus-on-error enabled and dynamic display:
|
|
|
45 |
</td>
|
|
|
46 |
<td class="sampleaction">
|
|
|
47 |
<com:TTextBox ID="TextBox3" Text="c"/>
|
|
|
48 |
<com:TRegularExpressionValidator
|
|
|
49 |
ValidationGroup="Group3"
|
|
|
50 |
ControlToValidate="TextBox3"
|
|
|
51 |
Display="Dynamic"
|
|
|
52 |
RegularExpression="\d{5}(-\d{4})?"
|
|
|
53 |
Text="Invalid US ZIP code." />
|
|
|
54 |
<com:TButton Text="Submit" ValidationGroup="Group3" />
|
|
|
55 |
</td>
|
|
|
56 |
</tr>
|
|
|
57 |
|
|
|
58 |
|
|
|
59 |
</table>
|
|
|
60 |
|
|
|
61 |
<div class="last-modified">$Id: Home.page 1650 2007-01-24 06:55:32Z wei $</div></com:TContent>
|