1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
---|
2 | "http://www.w3.org/TR/html4/strict.dtd"> |
---|
3 | <html> |
---|
4 | <head> |
---|
5 | <title>testing form and xhr utils</title> |
---|
6 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
---|
7 | <style type="text/css"> |
---|
8 | @import "../../resources/dojo.css"; |
---|
9 | </style> |
---|
10 | <script type="text/javascript" src="../../dojo.js" data-dojo-config="isDebug:true, ioPublish:true"></script> |
---|
11 | <script type="text/javascript"> |
---|
12 | require(["dojo", "doh", "dojo/domReady!"], function(dojo, doh){ |
---|
13 | var f1NoValueObj = null; |
---|
14 | var f1NoValue2Obj = 'blah'; |
---|
15 | var f2MultiObj = [ 'thud', 'thonk' ]; |
---|
16 | var f2TextareaObj = 'textarea_value'; |
---|
17 | var f2fileParam1Obj = ''; |
---|
18 | var f4ActionObj = 'Form with input named action'; |
---|
19 | var f6Checkbox1Obj = 'foo'; |
---|
20 | var f6Checkbox2Obj = null; |
---|
21 | var f6Radio1Obj = null; |
---|
22 | var f6Radio2Obj = 'bam'; |
---|
23 | |
---|
24 | |
---|
25 | var f1fo = { 'blah': "blah" }; |
---|
26 | var f1foStr = "blah=blah"; |
---|
27 | var f1foJson = '{"blah":"blah"}'; |
---|
28 | |
---|
29 | var f2fo = { |
---|
30 | blah: "blah", |
---|
31 | multi: [ |
---|
32 | "thud", |
---|
33 | "thonk" |
---|
34 | ], |
---|
35 | textarea: "textarea_value" |
---|
36 | }; |
---|
37 | var f2foStr = "blah=blah&multi=thud&multi=thonk&textarea=textarea_value"; |
---|
38 | var f2foJson = '{"blah":"blah","multi":["thud","thonk"],"textarea":"textarea_value"}'; |
---|
39 | |
---|
40 | var f3fo = { |
---|
41 | spaces: "string with spaces" |
---|
42 | }; |
---|
43 | var f3foStr = "spaces=string%20with%20spaces&"; |
---|
44 | var f3foJson = '{"spaces":"string with spaces"}'; |
---|
45 | |
---|
46 | var f5fo = { 'blåh': "bláh" }; |
---|
47 | var f5foStr = "bl%C3%A5h=bl%C3%A1h"; |
---|
48 | var f5foJson = '{"blåh":"bláh"}'; |
---|
49 | |
---|
50 | var f6fo = { |
---|
51 | cb_group: "foo", |
---|
52 | radio_group: "bam" |
---|
53 | }; |
---|
54 | |
---|
55 | var f6fo1 = { |
---|
56 | cb_group: "boo", |
---|
57 | radio_group: "baz" |
---|
58 | }; |
---|
59 | |
---|
60 | var f6fo2 = { |
---|
61 | cb_group: ["foo","boo"], |
---|
62 | radio_group: "baz" |
---|
63 | }; |
---|
64 | |
---|
65 | var topics = [ |
---|
66 | "/dojo/io/start", |
---|
67 | "/dojo/io/send", |
---|
68 | "/dojo/io/load", |
---|
69 | "/dojo/io/error", |
---|
70 | "/dojo/io/done", |
---|
71 | "/dojo/io/stop" |
---|
72 | ]; |
---|
73 | |
---|
74 | var topicCount = { |
---|
75 | }; |
---|
76 | |
---|
77 | dojo.forEach(topics, function(topic){ |
---|
78 | topicCount[topic] = 0; |
---|
79 | dojo.subscribe(topic, function(){ |
---|
80 | topicCount[topic] += 1; |
---|
81 | console.log("##"+ topic + ": " + topicCount[topic]); |
---|
82 | }); |
---|
83 | }); |
---|
84 | |
---|
85 | doh.register("t", |
---|
86 | [ |
---|
87 | function inputNodeValueFromId(t){ |
---|
88 | t.is(f1NoValueObj, dojo.fieldToObject('f1_no_value')); |
---|
89 | t.is(f1NoValue2Obj, dojo.fieldToObject('f1_no_value2')); |
---|
90 | t.is(f2MultiObj, dojo.fieldToObject('f2_multi')); |
---|
91 | t.is(f2TextareaObj, dojo.fieldToObject('f2_textarea')); |
---|
92 | t.is(f2fileParam1Obj, dojo.fieldToObject('f2_fileParam1')); |
---|
93 | t.is(f4ActionObj, dojo.fieldToObject('f4_action')); |
---|
94 | t.is(f6Checkbox1Obj, dojo.fieldToObject('f6_checkbox1')); |
---|
95 | t.is(f6Checkbox2Obj, dojo.fieldToObject('f6_checkbox2')); |
---|
96 | t.is(f6Radio1Obj, dojo.fieldToObject('f6_radio1')); |
---|
97 | t.is(f6Radio2Obj, dojo.fieldToObject('f6_radio2')); |
---|
98 | t.is(null, dojo.fieldToObject('some_id_that_doesnt_exist')); |
---|
99 | }, |
---|
100 | |
---|
101 | function formNodeValueFromNode(t){ |
---|
102 | t.is(f1NoValueObj, dojo.fieldToObject(dojo.byId('f1_no_value'))); |
---|
103 | t.is(f1NoValue2Obj, dojo.fieldToObject(dojo.byId('f1_no_value2'))); |
---|
104 | t.is(f2MultiObj, dojo.fieldToObject(dojo.byId('f2_multi'))); |
---|
105 | t.is(f2TextareaObj, dojo.fieldToObject(dojo.byId('f2_textarea'))); |
---|
106 | t.is(f2fileParam1Obj, dojo.fieldToObject(dojo.byId('f2_fileParam1'))); |
---|
107 | t.is(f4ActionObj, dojo.fieldToObject(dojo.byId('f4_action'))); |
---|
108 | t.is(f6Checkbox1Obj, dojo.fieldToObject(dojo.byId('f6_checkbox1'))); |
---|
109 | t.is(f6Checkbox2Obj, dojo.fieldToObject(dojo.byId('f6_checkbox2'))); |
---|
110 | t.is(f6Radio1Obj, dojo.fieldToObject(dojo.byId('f6_radio1'))); |
---|
111 | t.is(f6Radio2Obj, dojo.fieldToObject(dojo.byId('f6_radio2'))); |
---|
112 | t.is(null, dojo.fieldToObject(dojo.byId('some_id_that_doesnt_exist'))); |
---|
113 | }, |
---|
114 | function formNodeToObject(t){ |
---|
115 | t.is(f1fo , dojo.formToObject(dojo.byId("f1"))); |
---|
116 | t.is(f5fo , dojo.formToObject(dojo.byId("f5"))); |
---|
117 | }, |
---|
118 | function formIdToObject(t){ |
---|
119 | t.is(f1fo , dojo.formToObject("f1")); |
---|
120 | t.is(f5fo , dojo.formToObject("f5")); |
---|
121 | }, |
---|
122 | function formToObjectRadioGroup(t){ |
---|
123 | t.is(f6fo , dojo.formToObject("f6")); |
---|
124 | |
---|
125 | dojo.byId('f6_checkbox1').checked = false; |
---|
126 | dojo.byId('f6_checkbox2').checked = true; |
---|
127 | dojo.byId('f6_radio1').checked = true; |
---|
128 | t.is(f6fo1 , dojo.formToObject("f6")); |
---|
129 | |
---|
130 | dojo.byId('f6_checkbox1').checked = true; |
---|
131 | t.is(f6fo2 , dojo.formToObject("f6")); |
---|
132 | |
---|
133 | dojo.byId('f6_checkbox2').checked = false; // reset back to defaults |
---|
134 | dojo.byId('f6_radio2').checked = true; |
---|
135 | }, |
---|
136 | function formToObjectWithMultiSelect(t){ |
---|
137 | t.is(f2fo , dojo.formToObject("f2")); |
---|
138 | }, |
---|
139 | function objectToQuery(t){ |
---|
140 | t.is(f1foStr , dojo.objectToQuery(f1fo)); |
---|
141 | t.is(f5foStr , dojo.objectToQuery(f5fo)); |
---|
142 | }, |
---|
143 | function objectToQueryArr(t){ |
---|
144 | t.is(f2foStr, dojo.objectToQuery(f2fo)); |
---|
145 | }, |
---|
146 | function formToQuery(t){ |
---|
147 | t.is(f1foStr, dojo.formToQuery("f1")); |
---|
148 | t.is(f5foStr, dojo.formToQuery("f5")); |
---|
149 | }, |
---|
150 | function formToQueryArr(t){ |
---|
151 | t.is(f2foStr, dojo.formToQuery("f2")); |
---|
152 | }, |
---|
153 | function formToJson(t){ |
---|
154 | t.is(f1foJson, dojo.formToJson("f1")); |
---|
155 | t.is(dojo.fromJson(f5foJson), dojo.fromJson(dojo.formToJson("f5"))); |
---|
156 | }, |
---|
157 | function formToJsonArr(t){ |
---|
158 | t.is(f2foJson, dojo.formToJson("f2")); |
---|
159 | }, |
---|
160 | function queryToObject(t){ |
---|
161 | t.is(f1fo , dojo.queryToObject(f1foStr)); |
---|
162 | t.is(f2fo , dojo.queryToObject(f2foStr)); |
---|
163 | t.is(f3fo , dojo.queryToObject(f3foStr)); |
---|
164 | t.is(f5fo , dojo.queryToObject(f5foStr)); |
---|
165 | }, |
---|
166 | function textContentHandler(t){ |
---|
167 | t.is("foo bar baz ", |
---|
168 | dojo._contentHandlers.text({ |
---|
169 | responseText: "foo bar baz " |
---|
170 | }) |
---|
171 | ); |
---|
172 | }, |
---|
173 | function jsonContentHandler(t){ |
---|
174 | var jsonObj = { |
---|
175 | foo: "bar", |
---|
176 | baz: [ |
---|
177 | { thonk: "blarg" }, |
---|
178 | "xyzzy!" |
---|
179 | ] |
---|
180 | }; |
---|
181 | t.is(jsonObj, |
---|
182 | dojo._contentHandlers.json({ |
---|
183 | responseText: dojo.toJson(jsonObj) |
---|
184 | }) |
---|
185 | ); |
---|
186 | }, |
---|
187 | function jsonCFContentHandler(t){ |
---|
188 | var jsonObj = { |
---|
189 | foo: "bar", |
---|
190 | baz: [ |
---|
191 | { thonk: "blarg" }, |
---|
192 | "xyzzy!" |
---|
193 | ] |
---|
194 | }; |
---|
195 | var e; |
---|
196 | try{ |
---|
197 | dojo._contentHandlers["json-comment-filtered"]({ |
---|
198 | responseText: dojo.toJson(jsonObj) |
---|
199 | }) |
---|
200 | }catch(ex){ |
---|
201 | e = ex; |
---|
202 | }finally{ |
---|
203 | // did we fail closed? |
---|
204 | t.is((typeof e), "object"); |
---|
205 | } |
---|
206 | t.is(jsonObj, |
---|
207 | dojo._contentHandlers["json-comment-filtered"]({ |
---|
208 | responseText: "\tblag\n/*"+dojo.toJson(jsonObj)+"*/\n\r\t\r" |
---|
209 | }) |
---|
210 | ); |
---|
211 | t.is(jsonObj, |
---|
212 | dojo._contentHandlers["json-comment-optional"]({ |
---|
213 | responseText: "\tblag\n/*"+dojo.toJson(jsonObj)+"*/\n\r\t\r" |
---|
214 | }) |
---|
215 | ); |
---|
216 | }, |
---|
217 | function jsContentHandler(t){ |
---|
218 | var jsonObj = { |
---|
219 | foo: "bar", |
---|
220 | baz: [ |
---|
221 | { thonk: "blarg" }, |
---|
222 | "xyzzy!" |
---|
223 | ] |
---|
224 | }; |
---|
225 | t.is(jsonObj, |
---|
226 | dojo._contentHandlers["javascript"]({ |
---|
227 | responseText: "("+dojo.toJson(jsonObj)+")" |
---|
228 | }) |
---|
229 | ); |
---|
230 | t.t(dojo._contentHandlers["javascript"]({ |
---|
231 | responseText: "true;" |
---|
232 | }) |
---|
233 | ); |
---|
234 | t.f(dojo._contentHandlers["javascript"]({ |
---|
235 | responseText: "false;" |
---|
236 | }) |
---|
237 | ); |
---|
238 | }, |
---|
239 | function xmlContentHandler(t){ |
---|
240 | var fauxXhr = { responseText: "<foo><bar baz='thonk'>blarg</bar></foo>" }; |
---|
241 | if("DOMParser" in dojo.global){ |
---|
242 | var parser = new DOMParser(); |
---|
243 | fauxXhr.responseXML = parser.parseFromString(fauxXhr.responseText, "text/xml"); |
---|
244 | } |
---|
245 | var xmlDoc = dojo._contentHandlers["xml"](fauxXhr); |
---|
246 | t.is("foo", xmlDoc.documentElement.tagName); |
---|
247 | }, |
---|
248 | function xhrGet(t){ |
---|
249 | var d = new doh.Deferred(); |
---|
250 | var td = dojo.xhrGet({ |
---|
251 | url: "xhr.html", // self |
---|
252 | preventCache: true, |
---|
253 | load: function(text, ioArgs){ |
---|
254 | t.is(4, ioArgs.xhr.readyState); |
---|
255 | return text; //must return a value here or the parent test deferred fails. |
---|
256 | } |
---|
257 | }); |
---|
258 | t.t(td instanceof dojo.Deferred); |
---|
259 | td.addCallback(d, "callback"); |
---|
260 | return d; |
---|
261 | }, |
---|
262 | function xhrGet404(t){ |
---|
263 | var d = new doh.Deferred(); |
---|
264 | try{ |
---|
265 | var td = dojo.xhrGet({ |
---|
266 | url: "xhr_blarg.html", // doesn't exist |
---|
267 | error: function(err, ioArgs){ |
---|
268 | t.is(404, ioArgs.xhr.status); |
---|
269 | return err; //must return a value here or the parent test deferred fails. |
---|
270 | } |
---|
271 | }); |
---|
272 | // td.addErrback(d, "callback"); |
---|
273 | }catch(e){ |
---|
274 | d.callback(true); |
---|
275 | } |
---|
276 | // return d; |
---|
277 | }, |
---|
278 | function xhrGetContent(t){ |
---|
279 | var d = new doh.Deferred(); |
---|
280 | var td = dojo.xhrGet({ |
---|
281 | url: "xhr.html?color=blue", |
---|
282 | content: { |
---|
283 | foo: [ "bar", "baz" ], |
---|
284 | thud: "thonk", |
---|
285 | xyzzy: 3 |
---|
286 | } |
---|
287 | }); |
---|
288 | td.addCallback(function(text){ |
---|
289 | // console.debug(td, td.xhr, td.args); |
---|
290 | t.is("xhr.html?color=blue&foo=bar&foo=baz&thud=thonk&xyzzy=3", |
---|
291 | td.ioArgs.url); |
---|
292 | d.callback(true); |
---|
293 | }); |
---|
294 | return d; |
---|
295 | }, |
---|
296 | function xhrGetForm(t){ |
---|
297 | var d = new doh.Deferred(); |
---|
298 | var td = dojo.xhrGet({ |
---|
299 | url: "xhr.html", // self |
---|
300 | form: "f3" |
---|
301 | }); |
---|
302 | td.addCallback(function(xhr){ |
---|
303 | // console.debug(td.args.url); |
---|
304 | t.is("xhr.html?spaces=string%20with%20spaces", td.ioArgs.url); |
---|
305 | d.callback(true); |
---|
306 | }); |
---|
307 | return d; |
---|
308 | }, |
---|
309 | function xhrGetFormWithContent(t){ |
---|
310 | // ensure that stuff passed via content over-rides |
---|
311 | // what's specified in the form |
---|
312 | var d = new doh.Deferred(); |
---|
313 | var td = dojo.xhrGet({ |
---|
314 | url: "xhr.html", // self |
---|
315 | form: "f3", |
---|
316 | content: { spaces: "blah" } |
---|
317 | }); |
---|
318 | td.addCallback(function(xhr){ |
---|
319 | // console.debug(td.args.url); |
---|
320 | t.is("xhr.html?spaces=blah", td.ioArgs.url); |
---|
321 | d.callback(true); |
---|
322 | }); |
---|
323 | return d; |
---|
324 | }, |
---|
325 | function xhrPost(t){ |
---|
326 | var d = new doh.Deferred(); |
---|
327 | var td = dojo.xhrPost({ |
---|
328 | url: "xhr.html?foo=bar", // self |
---|
329 | content: { color: "blue"}, |
---|
330 | handle: function(res, ioArgs){ |
---|
331 | if((dojo._isDocumentOk(ioArgs.xhr))|| |
---|
332 | (ioArgs.xhr.status == 405) |
---|
333 | ){ |
---|
334 | d.callback(true); |
---|
335 | }else{ |
---|
336 | d.errback(false); |
---|
337 | } |
---|
338 | } |
---|
339 | }); |
---|
340 | // t.t(td instanceof dojo.Deferred); |
---|
341 | return d; |
---|
342 | }, |
---|
343 | function xhrPostWithContent(t){ |
---|
344 | var d = new doh.Deferred(); |
---|
345 | var td = dojo.xhrPost({ |
---|
346 | url: "xhr.html", |
---|
347 | content: { |
---|
348 | foo: [ "bar", "baz" ], |
---|
349 | thud: "thonk", |
---|
350 | xyzzy: 3 |
---|
351 | } |
---|
352 | }); |
---|
353 | td.addBoth(function(text){ |
---|
354 | t.is("foo=bar&foo=baz&thud=thonk&xyzzy=3", |
---|
355 | td.ioArgs.query); |
---|
356 | if( (dojo._isDocumentOk(td.ioArgs.xhr))|| |
---|
357 | (td.ioArgs.xhr.status == 405) |
---|
358 | ){ |
---|
359 | d.callback(true); |
---|
360 | }else{ |
---|
361 | d.errback(false); |
---|
362 | } |
---|
363 | }); |
---|
364 | return d; |
---|
365 | }, |
---|
366 | function xhrPostForm(t){ |
---|
367 | var d = new doh.Deferred(); |
---|
368 | var form = dojo.byId("f4"); |
---|
369 | |
---|
370 | //Make sure we can send a form to its |
---|
371 | //action URL. See trac: #2844. |
---|
372 | var td = dojo.xhrPost({ |
---|
373 | form: form |
---|
374 | }); |
---|
375 | td.addCallback(function(){ |
---|
376 | d.callback(true); |
---|
377 | }); |
---|
378 | td.addErrback(function(error){ |
---|
379 | d.callback(error); |
---|
380 | }); |
---|
381 | // t.t(td instanceof dojo.Deferred); |
---|
382 | return d; |
---|
383 | }, |
---|
384 | function rawXhrPost(t){ |
---|
385 | var d = new doh.Deferred(); |
---|
386 | var td = dojo.rawXhrPost({ |
---|
387 | url: "xhr.html", // self |
---|
388 | postData: "foo=bar&color=blue&height=average", |
---|
389 | handle: function(res, ioArgs){ |
---|
390 | if((dojo._isDocumentOk(ioArgs.xhr))|| |
---|
391 | (ioArgs.xhr.status == 405) |
---|
392 | ){ |
---|
393 | d.callback(true); |
---|
394 | }else{ |
---|
395 | d.errback(false); |
---|
396 | } |
---|
397 | } |
---|
398 | }); |
---|
399 | // t.t(td instanceof dojo.Deferred); |
---|
400 | return d; |
---|
401 | }, |
---|
402 | function xhrPut(t){ |
---|
403 | var d = new doh.Deferred(); |
---|
404 | var td = dojo.xhrPut({ |
---|
405 | url: "xhrDummyMethod.php?foo=bar", // self |
---|
406 | content: { color: "blue"}, |
---|
407 | handle: function(res, ioArgs){ |
---|
408 | if((dojo._isDocumentOk(ioArgs.xhr))|| |
---|
409 | (ioArgs.xhr.status == 403) |
---|
410 | ){ |
---|
411 | d.callback(true); |
---|
412 | }else{ |
---|
413 | d.errback(false); |
---|
414 | } |
---|
415 | } |
---|
416 | }); |
---|
417 | // t.t(td instanceof dojo.Deferred); |
---|
418 | return d; |
---|
419 | }, |
---|
420 | function xhrDelete(t){ |
---|
421 | var d = new doh.Deferred(); |
---|
422 | var td = dojo.xhrDelete({ |
---|
423 | url: "xhrDummyMethod.php", // self |
---|
424 | preventCache: true, |
---|
425 | handle: function(res, ioArgs){ |
---|
426 | if((dojo._isDocumentOk(ioArgs.xhr))|| |
---|
427 | (ioArgs.xhr.status == 403) |
---|
428 | ){ |
---|
429 | d.callback(true); |
---|
430 | }else{ |
---|
431 | d.errback(false); |
---|
432 | } |
---|
433 | } |
---|
434 | }); |
---|
435 | // t.t(td instanceof dojo.Deferred); |
---|
436 | return d; |
---|
437 | }, |
---|
438 | function xhrCancel(t){ |
---|
439 | var d = new doh.Deferred(); |
---|
440 | var td = dojo.xhrPost({ |
---|
441 | url: "xhrDummyMethod.php", // self |
---|
442 | handle: function(res, ioArgs){ |
---|
443 | if(res instanceof Error && res.dojoType == "cancel"){ |
---|
444 | d.callback(true); |
---|
445 | }else{ |
---|
446 | d.errback(false); |
---|
447 | } |
---|
448 | } |
---|
449 | }); |
---|
450 | td.cancel(); |
---|
451 | // t.t(td instanceof dojo.Deferred); |
---|
452 | return d; |
---|
453 | }, |
---|
454 | function xhrXMLQueryable(t){ |
---|
455 | var d = new doh.Deferred(); |
---|
456 | |
---|
457 | dojo.xhrGet({ |
---|
458 | url: "../request/xhrXml.php", |
---|
459 | handleAs: "xml", |
---|
460 | handle: function(res, ioArgs){ |
---|
461 | if(res instanceof Error){ |
---|
462 | d.errback(res); |
---|
463 | return; |
---|
464 | } |
---|
465 | try{ |
---|
466 | var results = dojo.query('bar', res); |
---|
467 | t.is(2, results.length); |
---|
468 | }catch(e){ |
---|
469 | d.errback(e); |
---|
470 | return; |
---|
471 | } |
---|
472 | d.callback(true); |
---|
473 | } |
---|
474 | }); |
---|
475 | |
---|
476 | return d; |
---|
477 | }, |
---|
478 | |
---|
479 | function ioPublish(t){ |
---|
480 | // TODO: this test needs to be rewritten as it is unreliable with the |
---|
481 | // 1.7 bootstrap that uses dojo.xhr |
---|
482 | return; |
---|
483 | |
---|
484 | //These numbers will look a bit odd at this point, since |
---|
485 | //some of the topics publish after this test is run. |
---|
486 | |
---|
487 | t.is(1, topicCount["/dojo/io/start"]); |
---|
488 | t.is(12, topicCount["/dojo/io/send"]); |
---|
489 | t.is(9, topicCount["/dojo/io/load"]); |
---|
490 | t.is(2, topicCount["/dojo/io/error"]); |
---|
491 | t.is(11, topicCount["/dojo/io/done"]); |
---|
492 | t.is(0, topicCount["/dojo/io/stop"]); |
---|
493 | |
---|
494 | /* |
---|
495 | dojo.forEach(topics, function(topic){ |
---|
496 | console.log(topic + ": " + topicCount[topic]); |
---|
497 | }); |
---|
498 | */ |
---|
499 | } |
---|
500 | ] |
---|
501 | ); |
---|
502 | doh.runOnLoad(); |
---|
503 | }); |
---|
504 | </script> |
---|
505 | </head> |
---|
506 | <body> |
---|
507 | <form id="f1" style="border: 1px solid black;"> |
---|
508 | <input id="f1_blah" type="text" name="blah" value="blah"> |
---|
509 | <input id="f1_no_value" type="text" name="no_value" value="blah" disabled> |
---|
510 | <input id="f1_no_value2" type="button" name="no_value2" value="blah"> |
---|
511 | </form> |
---|
512 | <form id="f2" style="border: 1px solid black;"> |
---|
513 | <input id="f2_blah" type="text" name="blah" value="blah"> |
---|
514 | <input id="f2_no_value" type="text" name="no_value" value="blah" disabled> |
---|
515 | <input id="f2_no_value2" type="button" name="no_value2" value="blah"> |
---|
516 | <select id="f2_multi" type="select" multiple name="multi" size="5"> |
---|
517 | <option value="blah">blah</option> |
---|
518 | <option value="thud" selected>thud</option> |
---|
519 | <option value="thonk" selected>thonk</option> |
---|
520 | </select> |
---|
521 | <textarea id="f2_textarea" name="textarea">textarea_value</textarea> |
---|
522 | <button id="f2_button1" name="button1" value="buttonValue1">This is a button that should not be in formToObject.</button> |
---|
523 | <input id="f2_fileParam1" type="file" name="fileParam1" value="fileValue1"> File input should not show up in formToObject. |
---|
524 | </form> |
---|
525 | <form id="f3" style="border: 1px solid black;"> |
---|
526 | <input id="f3_spaces" type="hidden" name="spaces" value="string with spaces"> |
---|
527 | </form> |
---|
528 | <form id="f4" style="border: 1px solid black;" action="xhrDummyMethod.php"> |
---|
529 | <input id="f4_action" type="hidden" name="action" value="Form with input named action"> |
---|
530 | </form> |
---|
531 | <form id="f5" style="border: 1px solid black;"> |
---|
532 | <input id="f5_blah" type="text" name="blåh" value="bláh"> |
---|
533 | <input id="f5_no_value" type="text" name="no_value" value="blah" disabled> |
---|
534 | <input id="f5_no_value2" type="button" name="no_value2" value="blah"> |
---|
535 | </form> |
---|
536 | <form id="f6" style="border: 1px solid black;"> |
---|
537 | <input id="f6_checkbox1" type="checkbox" name="cb_group" value="foo" checked> |
---|
538 | <input id="f6_checkbox2" type="checkbox" name="cb_group" value="boo"> |
---|
539 | <input id="f6_radio1" type="radio" name="radio_group" value="baz"> |
---|
540 | <input id="f6_radio2" type="radio" name="radio_group" value="bam" checked> |
---|
541 | </form> |
---|
542 | </body> |
---|
543 | </html> |
---|
544 | |
---|