blob: d8b43fadb47ebee75d189f70223804f9511dfe89 (
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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Form unit test</title>
<style type="text/css">
@import "../../../dojo/resources/dojo.css";
@import "../css/dijitTests.css";
</style>
<script type="text/javascript" src="../../../dojo/dojo.js"
djConfig="isDebug: true, parseOnLoad: true"></script>
<script type="text/javascript" src="../_testCommon.js"></script>
<script type="text/javascript">
dojo.require("dojo.date");
dojo.require("dijit.form.Form");
dojo.require("dijit.layout.LayoutContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.form.ComboBox");
dojo.require("dijit.form.CheckBox");
dojo.require("dijit.form.DateTextBox");
dojo.require("dijit.form.Button");
dojo.require("dijit.form.MultiSelect");
dojo.require("dijit.form.Textarea");
dojo.require("dijit.form.SimpleTextarea");
dojo.require("dijit.Editor");
</script>
</head>
<body>
<h1>Form Widget Unit Test</h1>
<form dojoType="dijit.form.Form" id="myForm1"
encType="multipart/form-data" action="" method="GET"
onSubmit="dojo.stopEvent(arguments[0]);"
onReset="dojo.stopEvent(arguments[0]);">
<h3>This form shouldn't submit, nor reset</h3>
<select name="plop.combo" dojoType="dijit.form.ComboBox">
<option value="one">one</option>
<option value="two">two</option>
<option value="three">three</option>
</select>
<button dojoType=dijit.form.Button type="submit">Submit</button>
<button dojoType=dijit.form.Button type="reset">Reset</button>
</form>
<form dojoType="dijit.form.Form" id="myForm2"
encType="multipart/form-data" action="" method="GET"
onSubmit="return false;"
onReset="return false;">
<h3>This form shouldn't submit, nor reset</h3>
<select name="plop.combo" dojoType="dijit.form.ComboBox">
<option value="one">one</option>
<option value="two">two</option>
<option value="three">three</option>
</select>
<button dojoType=dijit.form.Button type="submit">Submit</button>
<button dojoType=dijit.form.Button type="reset">Reset</button>
</form>
<form dojoType="dijit.form.Form" id="myForm3"
encType="multipart/form-data" action="" method="GET"
onSubmit="return true;"
onReset="return true;">
<h3>This form <em>should</em> submit and reset</h3>
<select name="plop.combo" dojoType="dijit.form.ComboBox">
<option value="one">one</option>
<option value="two">two</option>
<option value="three">three</option>
</select>
<button dojoType=dijit.form.Button type="submit">Submit</button>
<button dojoType=dijit.form.Button type="reset">Reset</button>
</form>
<form dojoType="dijit.form.Form" id="myForm4"
encType="multipart/form-data" action="" method="GET"
onSubmit="void(0)"
onReset="void(0)">
<h3>This form <em>should</em> submit and reset</h3>
<select name="plop.combo" dojoType="dijit.form.ComboBox">
<option value="one">one</option>
<option value="two">two</option>
<option value="three">three</option>
</select>
<button dojoType=dijit.form.Button type="submit">Submit</button>
<button dojoType=dijit.form.Button type="reset">Reset</button>
</form>
</body>
</html>
|