summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/Samples/TRequiredFieldValidator/Home.page
blob: e5c27cd00ecd3eb94ae00b1dfb7165aedd10c687 (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<com:TContent ID="body">

<h1>TRequiredFieldValidator Samples</h1>

<table class="sampletable">

<tr>
<td class="samplenote">
Validator with default settings:
</td>
<td class="sampleaction">
<com:TTextBox ID="TextBox1" />
<com:TRequiredFieldValidator
	ValidationGroup="Group1"
	ControlToValidate="TextBox1"
	Text="Field required." />
<com:TButton Text="Submit" ValidationGroup="Group1" />
</td>
</tr>

<tr>
<td class="samplenote">
Validator with client-side validation disabled:
</td>
<td class="sampleaction">
<com:TTextBox ID="TextBox2" />
<com:TRequiredFieldValidator
	ValidationGroup="Group2"
	EnableClientScript="false"
	ControlToValidate="TextBox2"
	Text="Field required." />
<com:TButton Text="Submit" ValidationGroup="Group2" />
</td>
</tr>

<tr>
<td class="samplenote">
Validator with focus-on-error enabled and dynamic display:
</td>
<td class="sampleaction">
<com:TTextBox ID="TextBox3" />
<com:TRequiredFieldValidator
	ValidationGroup="Group3"
	Display="Dynamic"
	ControlToValidate="TextBox3"
	FocusOnError="true"
	Text="Field required." />
<com:TButton Text="Submit" ValidationGroup="Group3" />
</td>
</tr>

<tr>
<td class="samplenote">
Validating if initial value (test) is changed:
</td>
<td class="sampleaction">
<com:TTextBox ID="TextBox4" Text="test" />
<com:TRequiredFieldValidator
	ValidationGroup="Group4"
	Display="Dynamic"
	ControlToValidate="TextBox4"
	InitialValue="test"
	Text="Input must not be 'test'." />
<com:TButton Text="Submit" ValidationGroup="Group4" />
</td>
</tr>

<tr>
<td class="samplenote">
Validating if checkbox is checked:
</td>
<td class="sampleaction">
<com:TCheckBox ID="CheckBox" Text="agree" />
<com:TRequiredFieldValidator
	ValidationGroup="Group5"
	Display="Dynamic"
	ControlToValidate="CheckBox"
	Text="You must agree." />
<com:TButton Text="Submit" ValidationGroup="Group5" />
</td>
</tr>

<tr>
<td class="samplenote">
Validating if a selection has been made in a dropdown list:
</td>
<td class="sampleaction">
<com:TDropDownList ID="DropDownList">
  <com:TListItem Value="value 1" Text="text 1" Selected="true" />
  <com:TListItem Value="value 2" Text="text 2" />
  <com:TListItem Value="value 3" Text="text 3" />
</com:TDropDownList>
<com:TRequiredFieldValidator
	ValidationGroup="Group6"
	ControlToValidate="DropDownList"
	InitialValue="value 1"
	Text="A selection must be made." />
<com:TButton Text="Submit" ValidationGroup="Group6" />
</td>
</tr>

<tr>
<td class="samplenote">
Validating if a selection has been made in a dropdown list:
</td>
<td class="sampleaction">
<com:TListBox ID="ListBox">
  <com:TListItem Value="value 1" Text="text 1" />
  <com:TListItem Value="value 2" Text="text 2" />
  <com:TListItem Value="value 3" Text="text 3" />
</com:TListBox>
<com:TRequiredFieldValidator
	ValidationGroup="Group7"
	ControlToValidate="ListBox"
	Text="A selection must be made." />
<com:TButton Text="Submit" ValidationGroup="Group7" />
</td>
</tr>

</table>

</com:TContent>