| 1 |
lars |
1 |
<com:TContent ID="body">
|
|
|
2 |
<h1>Conditional Validation (client-side + server side)</h1>
|
|
|
3 |
|
|
|
4 |
<table class="sampletable">
|
|
|
5 |
<tr>
|
|
|
6 |
<td class="samplenote">
|
|
|
7 |
Validator with default settings:<br />
|
|
|
8 |
Check "optional" to validate both textboxes
|
|
|
9 |
</td>
|
|
|
10 |
<td class="sampleaction">
|
|
|
11 |
<com:TTextBox ID="text1" />
|
|
|
12 |
<com:TRequiredFieldValidator
|
|
|
13 |
ID="validator1"
|
|
|
14 |
ControlToValidate="text1"
|
|
|
15 |
ErrorMessage="*"
|
|
|
16 |
ControlCssClass="required"/>
|
|
|
17 |
<com:TTextBox ID="text2" />
|
|
|
18 |
<com:TRequiredFieldValidator
|
|
|
19 |
ID="validator2"
|
|
|
20 |
ControlToValidate="text2"
|
|
|
21 |
OnValidate="check_validate"
|
|
|
22 |
ErrorMessage="*"
|
|
|
23 |
ControlCssClass="required">
|
|
|
24 |
<prop:ClientSide.OnValidate>
|
|
|
25 |
sender.enabled = $('<%= $this->check1->ClientID %>').checked;
|
|
|
26 |
</prop:ClientSide.OnValidate>
|
|
|
27 |
|
|
|
28 |
</com:TRequiredFieldValidator>
|
|
|
29 |
<com:TCheckBox ID="check1" Text="Optional" />
|
|
|
30 |
<com:TButton ID="submit1" Text="Submit" />
|
|
|
31 |
</td>
|
|
|
32 |
</tr>
|
|
|
33 |
|
|
|
34 |
</table>
|
|
|
35 |
|
|
|
36 |
<div class="last-modified">$Id: Home.page 1784 2007-03-27 08:34:28Z wei $</div></com:TContent>
|