summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page
blob: f7d03ea242612199432ea22286914b856a95a59c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<com:TContent ID="body">
<h1>Conditional Validation (client-side + server side)</h1>

<com:TStyleSheet>
.required {
	background-color: #E77471;
}
</com:TStyleSheet>
<table class="sampletable">
<tr>
<td class="samplenote">
Validator with default settings:<br />
Check "optional" to validate both textboxes
</td>
<td class="sampleaction">
		<com:TTextBox ID="text1" />
		<com:TRequiredFieldValidator
			ID="validator1"
			ControlToValidate="text1"
			ErrorMessage="*"
			ControlCssClass="required"/>
		<com:TTextBox ID="text2" />
		<com:TRequiredFieldValidator
			ID="validator2"
			ControlToValidate="text2"
			OnValidate="check_validate"
			ErrorMessage="*"
			ControlCssClass="required">
		<prop:ClientSide.OnValidate>
			sender.enabled = jQuery('#<%= $this->check1->ClientID %>').get(0).checked;
		</prop:ClientSide.OnValidate>

		</com:TRequiredFieldValidator>
		<com:TCheckBox ID="check1" Text="Optional" />
	<com:TButton ID="submit1" Text="Submit" />
</td>
</tr>

</table>

</com:TContent>