aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dijit/tests/_base/test_placeStrict.html
blob: c40325c9d37a978102f6e40e22e59330e0424b6f (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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title>dijit.place tests</title>
		<script type="text/javascript" src="../../../dojo/dojo.js"
			djConfig="isDebug: true, extraLocale: ['de-de', 'en-us']"></script>
		<script type="text/javascript">
			dojo.require("dijit.dijit");
		</script>
		<script>
			dojo.addOnLoad(function(){
				var vp = dijit.getViewport();
				alert("viewport w="+vp.w + ", h=" + vp.h);
			});
		</script>
		<style type="text/css">
			@import "../../../dojo/resources/dojo.css";
			@import "../../themes/tundra/tundra.css";
			@import "../css/dijitTests.css";

			body {
				padding: 1em;
			}
			.formQuestion {
				background-color:#d0e3f5;
				padding:0.3em;
				font-weight:900;
				font-family:Verdana, Arial, sans-serif;
				font-size:0.8em;
				color:#5a5a5a;
			}
			.formAnswer {
				background-color:#f5eede;
				padding:0.3em;
				margin-bottom:1em;
			}
			.pageSubContentTitle {
					color:#8e8e8e;
					font-size:1em;
					font-family:Verdana, Arial, sans-serif;
					margin-bottom:0.75em;
			}
			.small {
				width: 2.5em;
			}
			.medium {
				width: 10em;
			}
			.long {
				width: 20em;
			}

			.dojoValidationTextBoxMessage {
				display: inline;
				margin-left: 1em;
				font-weight: bold;
				font-style: italic;
				font-family: Arial, Verdana, sans-serif;
				color: #f66;
				font-size: 0.9em;
			}

			.noticeMessage {
				font-weight: normal;
				font-family:Arial, Verdana, sans-serif;
				color:#663;
				font-size:0.9em;
			}
		</style>
	</head>

	<body class=tundra>
		<h2 class="pageSubContentTitle">Test dijit.place</h2>
		<p>Currently this just tests getViewport().  Change the size of your browser window and then reload,
		and see if it reports the browser window size correctly.<br>
		<p>All the text below is just filler text...<br>
		<!--	to test form submission, you'll need to create an action handler similar to
			http://www.utexas.edu/teamweb/cgi-bin/generic.cgi -->
		<form id="form1" action="" name="example" method="post">

			<div class="formQuestion">
				<span class="emphasize"><label for="q01">First Name:  </label></span>
				<span class="noticeMessage"> TextBox class, <b>tabIndex=2</b>, Attributes: {trim: true, ucFirst: true, class: 'medium'}, First letter of each word is upper case.</span>
			</div>
			<div class="formAnswer">
				<input id="q01" type="text" name="firstname" value="testing testing" class="medium" tabIndex=2
					dojoType="dijit.form.TextBox"
					trim="true"
					ucfirst="true" />
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q02">Last Name:  </label></span>
				<span class="noticeMessage"> TextBox class, Attributes: {trim: true, uppercase: true, class: 'medium'}, all letters converted to upper case. </span>
			</div>
			<div class="formAnswer">
				<input id="q02" type="text" name="lastname" value="testing testing" class="medium"
					dojoType="dijit.form.TextBox"
					trim="true"
					uppercase="true" />
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q03">Age:  </label></span>
				<span class="noticeMessage"> TextBox class, <b>tabIndex=1</b>, Attributes: {trim: true, digit: true, class: 'small'}, all but digits extracted.</span>
			</div>
			<div class="formAnswer">
				<input id="q03" type="text" name="age" value="38" class="small" tabIndex=1
					dojoType="dijit.form.NumberTextBox"
					promptMessage="(optional) Enter an age between 0 and 120"
					constraints={places:0,min:0,max:120}
					onChange="console.debug('onChange fired for widget id = ' + this.id + ' with value = ' + arguments[0]);"
					digit="true"
					trim="true"
					/>
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q04">Occupation:  </label></span>
				<span class="noticeMessage">ValidationTextBox class,
					Attributes: {lowercase: true, required: true}. Displays a prompt message if field is missing. </span>
			</div>
			<div class="formAnswer">
				<input id="q04" type="text" name="occupation" class="medium"
					dojoType="dijit.form.ValidationTextBox"
					lowercase="true"
					required="true"
					promptMessage="Enter an occupation" />
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q05">Elevation:  </label></span>
				<span class="noticeMessage">IntegerTextBox class,
					Attributes: {required: true, min:-20000, max:+20000 }, Enter feet above sea level with a sign.</span>
			</div>
			<div class="formAnswer">
				<input id="q05" class="medium"/>
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q08">Annual Income:  </label></span>
				<span class="noticeMessage">CurrencyTextBox class,
					Attributes: {fractional: true}. Enter whole and cents.  Currency symbol is optional.</span>
			</div>
			<div class="formAnswer">
				<input id="q08" type="text" name="income1" class="medium" value="54775.53"
					dojoType="dijit.form.CurrencyTextBox"
					required="true"
					currency="USD"
					invalidMessage="Invalid amount.  Include dollar sign, commas, and cents. Example: $12,000.00" />USD
			</div>

			<div class="formAnswer">
				<input id="q08eur" type="text" name="income2" class="medium" value="54775.53"
					dojoType="dijit.form.CurrencyTextBox"
					required="true"
					currency="EUR"
					invalidMessage="Invalid amount.  Include euro sign, commas, and cents. Example: &#x20ac;12,000.00" />EUR
			</div>
<!--
			<div class="formQuestion">
				<span class="emphasize"><label for="q08a">Annual Income:  </label></span>
				<span class="noticeMessage">Old regexp currency textbox,
					Attributes: {fractional: true}. Enter dollars and cents.</span>
			</div>
			<div class="formAnswer">
				<input id="q08a" type="text" name="income3" class="medium" value="$54,775.53"
					dojoType="dijit.form.ValidationTextBox"
					regExpGen="dojo.regexp.currency"
					trim="true"
					required="true"
					constraints={fractional:true}
					invalidMessage="Invalid amount.  Include dollar sign, commas, and cents. Example: $12,000.00" />
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q09">IPv4 Address:  </label></span>
				<span class="noticeMessage">IpAddressTextBox class,
					Attributes: {allowIPv6: false, allowHybrid: false}. Also Dotted Hex works, 0x18.0x11.0x9b.0x28</span>
			</div>
			<div class="formAnswer">
				<input id="q09" type="text" name="ipv4" class="medium" value="24.17.155.40"
					dojoType="dijit.form.ValidationTextBox"
					regExpGen="dojo.regexp.ipAddress"
					trim="true"
					required="true"
					constraints={allowIPv6:false,allowHybrid:false}
					invalidMessage="Invalid IPv4 address." />
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q10"> IPv6 Address:  </label></span>
				<span class="noticeMessage">IpAddressTextBox class,
					Attributes: {allowDottedDecimal: false, allowDottedHex: false}.
					Also hybrid works, x:x:x:x:x:x:d.d.d.d</span>
			</div>
			<div class="formAnswer">
				<input id="q10" type="text" name="ipv6" class="long" value="0000:0000:0000:0000:0000:0000:0000:0000"
					dojoType="dijit.form.ValidationTextBox"
					regExpGen="dojo.regexp.ipAddress"
					trim="true"
					uppercase = "true"
					required="true"
					constraints={allowDottedDecimal:false, allowDottedHex:false, allowDottedOctal:false}
					invalidMessage="Invalid IPv6 address, please enter eight groups of four hexadecimal digits. x:x:x:x:x:x:x:x" />
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q11"> URL:  </label></span>
				<span class="noticeMessage">UrlTextBox class,
					Attributes: {required: true, trim: true, scheme: true}. </span>
			</div>
			<div class="formAnswer">
				<input id="q11" type="text" name="url" class="long" value="http://www.xyz.com/a/b/c?x=2#p3"
					dojoType="dijit.form.ValidationTextBox"
					regExpGen="dojo.regexp.url"
					trim="true"
					required="true"
					constraints={scheme:true}
					invalidMessage="Invalid URL.  Be sure to include the scheme, http://..." />
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q12"> Email Address  </label></span>
				<span class="noticeMessage">EmailTextBox class,
					Attributes: {required: true, trim: true}. </span>
			</div>
			<div class="formAnswer">
				<input id="q12" type="text" name="email" class="long" value="fred&barney@stonehenge.com"
					dojoType="dijit.form.ValidationTextBox"
					regExpGen="dojo.regexp.emailAddress"
					trim="true"
					required="true"
					invalidMessage="Invalid Email Address." />
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q13"> Email Address List </label></span>
				<span class="noticeMessage">EmailListTextBox class,
					Attributes: {required: true, trim: true}. </span>
			</div>
			<div class="formAnswer">
				<input id="q13" type="text" name="email" class="long" value="a@xyz.com; b@xyz.com; c@xyz.com; "
					dojoType="dijit.form.ValidationTextBox"
					regExpGen="dojo.regexp.emailAddressList"
					trim="true"
					required="true"
					invalidMessage="Invalid Email Address List." />
			</div>
-->

			<div class="formQuestion">
				<span class="emphasize"><label for="q14"> Date (American format) </label></span>
				<span class="noticeMessage">DateTextBox class,
					Attributes: {locale: "en-us", required: true}. Works for leap years</span>
			</div>
			<div class="formAnswer">
				<input id="q14" type="text" name="date1" class="medium" value="2005-12-30"
					dojoType="dijit.form.DateTextBox"
					constraints={locale:'en-us'}
					required="true"
					promptMessage="mm/dd/yyyy"
					invalidMessage="Invalid date. Use mm/dd/yyyy format." />
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q15"> Date (German format) </label></span>
				<span class="noticeMessage">DateTextBox class,
					Attributes: {locale: "de-de", min:2006-01-01, max:2006-12-31}. Works for leap years</span>
			</div>
			<div class="formAnswer">
				<input id="q15" class="medium"/>
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q16"> 12 Hour Time </label></span>
				<span class="noticeMessage">TimeTextBox class,
					Attributes: {formatLength: "medium", required: true, trim: true}</span>
			</div>
			<div class="formAnswer">
				<input id="q16" type="text" name="time1" class="medium" value="5:45:00 pm"
					dojoType="dijit.form.ValidationTextBox"
					validator="dojo.date.local.parse"
					constraints={formatLength:'medium',selector:'time'}
					trim="true"
					required="true"
					invalidMessage="Invalid time." />
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q17"> 24 Hour Time</label></span>
				<span class="noticeMessage">TimeTextBox class,
					Attributes: {displayFormat:"HH:mm:ss", required: true, trim: true}</span>
			</div>
			<div class="formAnswer">
				<input id="q17" type="text" name="time2" class="medium" value="17:45:00"
					dojoType="dijit.form.ValidationTextBox"
					validator="dojo.date.local.parse"
					constraints={formatLength:'short',selector:'time',timePattern:'HH:mm:ss'}
					trim="true"
					required="true"
					invalidMessage="Invalid time. Use HH:mm:ss where HH is 00 - 23 hours." />
			</div>

<!--
			<div class="formQuestion">
				<span class="emphasize"><label for="q18"> US State 2 letter abbr. </label></span>
				<span class="noticeMessage">UsStateTextBox class,
					Attributes: {required: true, trim: true, uppercase: true}</span>
			</div>
			<div class="formAnswer">
				<input id="q18" type="text" name="state" class="small" value="CA"
					dojoType="dijit.form.ValidationTextBox"
					regExpGen="dojo.regexp.us.state"
					constraints={allowTerritories:false}
					trim="true"
					uppercase="true"
					required="true"
					invalidMessage="Invalid US state abbr." />
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q19"> US Zip Code </label></span>
				<span class="noticeMessage">UsZipTextBox class,
					Attributes: {required: true, trim: true} Five digit Zip code or 5 + 4.</span>
			</div>
			<div class="formAnswer">
				<input id="q19" type="text" name="zip" class="medium" value="98225-1649"
					dojoType="dijit.form.ValidationTextBox"
					validator="dojo.validate.us.isZipCode"
					trim="true"
					required="true"
					invalidMessage="Invalid US Zip Code." />
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q20"> US Social Security Number </label></span>
				<span class="noticeMessage">UsSocialSecurityNumberTextBox class,
					Attributes: {required: true, trim: true} </span>
			</div>
			<div class="formAnswer">
				<input id="q20" type="text" name="ssn" class="medium" value="123-45-6789"
					dojoType="dijit.form.ValidationTextBox"
					validator="dojo.validate.us.isSocialSecurityNumber"
					trim="true"
					required="true"
					invalidMessage="Invalid US Social Security Number." />
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q21"> 10-digit US Phone Number </label></span>
				<span class="noticeMessage">UsPhoneNumberTextBox class,
					Attributes: {required: true, trim: true} </span>
			</div>
			<div class="formAnswer">
				<input id="q21" type="text" name="phone" class="medium" value="(123) 456-7890"
					dojoType="dijit.form.ValidationTextBox"
					validator="dojo.validate.us.isPhoneNumber"
					trim="true"
					required="true"
					invalidMessage="Invalid US Phone Number." />
			</div>
 -->
			<div class="formQuestion">
				<span class="emphasize"><label for="q22"> Regular Expression </label></span>
				<span class="noticeMessage">RegexpTextBox class,
					Attributes: {required: true} </span>
			</div>
			<div class="formAnswer">
				<input id="q22" type="text" name="phone" class="medium" value="someTestString"
					dojoType="dijit.form.ValidationTextBox"
					regExp="[\w]+"
					required="true"
					invalidMessage="Invalid Non-Space Text." />
			</div>

			<div class="formQuestion">
				<span class="emphasize"><label for="q23"> Password </label></span>
				<span class="noticeMessage">(just a test that type attribute is obeyed) </span>
			</div>
			<div class="formAnswer">
				<input id="q23" type="password" name="password" class="medium"
					dojoType="dijit.form.TextBox" />
			</div>

			<div class="formQuestion">
					<span class="emphasize"><label for="ticket1651">Trac ticket 1651:  </label></span>
					<span class="noticeMessage">value: null should show up as empty</span>
			</div>
			<div class="formAnswer">
					<input id="ticket1651" class="medium" value="not null"/>
			</div>

			<button name="button" onclick="displayData(); return false;">view data</button>
			<input type="submit" name="submit" />
		</form>
	</body>
</html>