| 1 |
lars |
1 |
<com:TContent ID="body">
|
|
|
2 |
|
|
|
3 |
<h1>TDataTypeValidator Samples</h1>
|
|
|
4 |
<p><strong>Note:</strong> TDataTypeValidator will start
|
|
|
5 |
to validate only if both inputs are not empty.</p>
|
|
|
6 |
|
|
|
7 |
<table class="sampletable">
|
|
|
8 |
|
|
|
9 |
<tr>
|
|
|
10 |
<td class="samplenote">
|
|
|
11 |
Data type validator with default settings:
|
|
|
12 |
</td>
|
|
|
13 |
<td class="sampleaction">
|
|
|
14 |
<com:TTextBox ID="TextBox1" Text="a" />
|
|
|
15 |
<com:TDataTypeValidator
|
|
|
16 |
ValidationGroup="Group1"
|
|
|
17 |
ControlToValidate="TextBox1"
|
|
|
18 |
DataType="Float"
|
|
|
19 |
Text="You must enter a floating number." />
|
|
|
20 |
<com:TButton Text="Submit" ValidationGroup="Group1" />
|
|
|
21 |
</td>
|
|
|
22 |
</tr>
|
|
|
23 |
|
|
|
24 |
<tr>
|
|
|
25 |
<td class="samplenote">
|
|
|
26 |
Data type validator with client-side validation disabled:
|
|
|
27 |
</td>
|
|
|
28 |
<td class="sampleaction">
|
|
|
29 |
<com:TTextBox ID="TextBox2" Text="a"/>
|
|
|
30 |
<com:TDataTypeValidator
|
|
|
31 |
ValidationGroup="Group2"
|
|
|
32 |
EnableClientScript="false"
|
|
|
33 |
ControlToValidate="TextBox2"
|
|
|
34 |
DataType="Integer"
|
|
|
35 |
Text="You must enter an integer." />
|
|
|
36 |
<com:TButton Text="Submit" ValidationGroup="Group2" />
|
|
|
37 |
</td>
|
|
|
38 |
</tr>
|
|
|
39 |
|
|
|
40 |
<tr>
|
|
|
41 |
<td class="samplenote">
|
|
|
42 |
Validating a date input:
|
|
|
43 |
</td>
|
|
|
44 |
<td class="sampleaction">
|
|
|
45 |
<com:TTextBox ID="TextBox3" Text="a" />
|
|
|
46 |
<com:TDataTypeValidator
|
|
|
47 |
ValidationGroup="Group3"
|
|
|
48 |
ControlToValidate="TextBox3"
|
|
|
49 |
DataType="Date"
|
|
|
50 |
DateFormat="d/M/yyyy"
|
|
|
51 |
Text="You must enter a valid date (d/M/yyyy)." />
|
|
|
52 |
<com:TButton Text="Submit" ValidationGroup="Group3" />
|
|
|
53 |
</td>
|
|
|
54 |
</tr>
|
|
|
55 |
|
|
|
56 |
</table>
|
|
|
57 |
|
|
|
58 |
<div class="last-modified">$Id: Home.page 1650 2007-01-24 06:55:32Z wei $</div></com:TContent>
|