summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/Samples/TTextBox/Home.page
blob: 1c307779315a2cc62f0f6a34310592f715e28e6b (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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<com:TContent ID="body">

<h1>TTextBox Samples</h1>

<h2>SingeLine Text Boxes</h2>

<table class="sampletable">

<tr><td class="samplenote">
Text box with default settings:
</td><td class="sampleaction">
<com:TTextBox />
</td></tr>

<tr><td class="samplenote">
Text box with customized color, font, columns, maximum length:
</td><td class="sampleaction">
<com:TTextBox
	Text="text"
	ForeColor="yellow"
	BackColor="blue"
	Font.Size="14pt"
	Columns="4"
	MaxLength="6"
/>
</td></tr>

<tr><td class="samplenote">
Text box with vCard support:
</td><td class="sampleaction">
First Name: <com:TTextBox AutoCompleteType="FirstName" />
Last Name: <com:TTextBox AutoCompleteType="LastName" />
</td></tr>

<tr><td class="samplenote">
Disabled text box:
</td><td class="sampleaction">
<com:TTextBox Text="disabled" Enabled="false" />
</td></tr>

<tr><td class="samplenote">
Read-only text box:
</td><td class="sampleaction">
<com:TTextBox Text="read only" ReadOnly="true" />
</td></tr>

<tr><td class="samplenote">
Auto postback text box not causing validation:
</td><td class="sampleaction">
<com:TTextBox
	Text="change me"
	AutoPostBack="true"
	CausesValidation="false"
	OnTextChanged="textChanged" />
</td></tr>

<tr><td class="samplenote">
Auto postback text box causing validation:
</td><td class="sampleaction">
<com:TTextBox ID="TextBox3"
	Width="300px"
	AutoPostBack="true"
	ValidationGroup="Group1"
	Text="change me to 'test' and see" />
<com:TRequiredFieldValidator
	ControlToValidate="TextBox3"
	ErrorMessage="You must enter a value not equal to 'test'."
	InitialValue="test"
	ValidationGroup="Group1" />
</td></tr>

<tr><td class="samplenote">
Text box's behavior upon postback:
</td><td class="sampleaction">
<com:TTextBox ID="TextBox1" Text="text" />
<com:TButton
	Text="Submit"
	OnClick="submitText" />
</td></tr>

<tr><td class="samplenote">
Safety feature (cross-site scripting prevention):
</td><td class="sampleaction">
<com:TTextBox
	ID="TextBox2"
	AutoPostBack="true"
	Text="<a href=javascript:xxx>test</a>"
	Width="200px"/>
<b>SafeText:</b>
<com:TLabel ID="Output"
	BackColor="silver"
	Text=<%#$this->TextBox2->SafeText%> />
</td></tr>

</table>

<h2>Password Text Boxes</h2>

<table class="sampletable">

<tr><td class="samplenote">
Password with default setting
</td>
<td class="sampleaction">
<com:TTextBox TextMode="Password" /> <com:TButton ID="PassButton1" Text="submit" />
</td></tr>

<tr><td class="samplenote">
Password with PersistPasswor set true
</td>
<td class="sampleaction">
<com:TTextBox ID="Password2" TextMode="Password" PersistPassword="true" /> 
<com:TButton ID="PassButton2" Text="submit" />
</td></tr>
</table>


<h2>MultiLine Text Boxes</h2>

<table class="sampletable">

<tr><td class="samplenote">
Text box with default settings:
</td><td class="sampleaction">
<com:TTextBox TextMode="MultiLine" />
</td></tr>

<tr><td class="samplenote">
Text box with customized dimensions, font and content:
</td><td class="sampleaction">
<com:TTextBox TextMode="MultiLine" Rows="6" Columns="60" Font.Italic="true">
  <prop:Text>
This is a multiline text box.
In HTML, it is displayed as a textarea.
  </prop:Text>
</com:TTextBox>
</td></tr>

<tr><td class="samplenote">
Disabled text box:
</td><td class="sampleaction">
<com:TTextBox
	TextMode="MultiLine"
	Text="disabled"
	Enabled="false" />
</td></tr>

<tr><td class="samplenote">
Read-only text box with text-wrapping disabled:
</td><td class="sampleaction">
<com:TTextBox
	TextMode="MultiLine"
	Text="This is a read-only text box with text-wrapping disabled."
	ReadOnly="true"
	Wrap="false"/>
</td></tr>

<tr><td class="samplenote">
Auto postback text box not causing validation:
</td><td class="sampleaction">
<com:TTextBox
	TextMode="MultiLine"
	Text="change me"
	AutoPostBack="true"
	CausesValidation="false"
	OnTextChanged="textChanged" />
</td></tr>

<tr><td class="samplenote">
Auto postback text box causing validation:
</td><td class="sampleaction">
<com:TTextBox ID="MultiTextBox3"
	TextMode="MultiLine"
	AutoPostBack="true"
	ValidationGroup="Group2"
	Text="change me to 'demo' and see" />
<com:TRequiredFieldValidator
	ControlToValidate="MultiTextBox3"
	ErrorMessage="You must enter a value not equal to 'demo'."
	InitialValue="demo"
	ValidationGroup="Group2" />
</td></tr>

</table>

<div class="last-modified">$Id$</div></com:TContent>