summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.page
blob: 65195a5563681d6c5f054006a8f2dd4ef1e5a21a (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<com:TContent ID="body">

<script type="text/javascript"><!--
function myValidationFunction(sender, parameter)
{
    if(parameter == 'test')
        return true;
    else
        return false;
}
--></script>

<h1>TCustomValidator Samples</h1>

<table class="sampletable">

<tr>
<td class="samplenote">
Custom validator with default settings:
</td>
<td class="sampleaction">
<com:TTextBox ID="TextBox1" />
<com:TCustomValidator
	ValidationGroup="Group1"
	ControlToValidate="TextBox1"
	ClientValidationFunction="myValidationFunction"
	OnServerValidate="serverValidate"
	Text="You must enter 'test'." />
<com:TButton Text="Submit" ValidationGroup="Group1" />
</td>
</tr>

<tr>
<td class="samplenote">
Custom validator with client-side validation disabled:
</td>
<td class="sampleaction">
<com:TTextBox ID="TextBox2" />
<com:TCustomValidator
	ValidationGroup="Group2"
	EnableClientScript="false"
	ControlToValidate="TextBox2"
	ClientValidationFunction="myValidationFunction"
	OnServerValidate="serverValidate"
	Text="You must enter 'test'." />
<com:TButton Text="Submit" ValidationGroup="Group2" />
</td>
</tr>

<tr>
<td class="samplenote">
Custom validator with focus-on-error enabled and dynamic display:
</td>
<td class="sampleaction">
<com:TTextBox ID="TextBox3" />
<com:TCustomValidator
	ValidationGroup="Group3"
	ControlToValidate="TextBox3"
	ClientValidationFunction="myValidationFunction"
	OnServerValidate="serverValidate"
	FocusOnError="true"
	Text="You must enter 'test'." />
<com:TButton Text="Submit" ValidationGroup="Group3" />
</td>
</tr>

<tr>
<td class="samplenote">
Custom validator without ControlToValidate:
</td>
<td class="sampleaction">
<com:TTextBox ID="TextBox4" />
<com:TCustomValidator
	ValidationGroup="Group4"
	OnServerValidate="serverValidateNoControl"
	Text="You must enter 'test'." />
<com:TButton Text="Submit" ValidationGroup="Group4" />
</td>
</tr>

</table>

</com:TContent>