This repository has been archived by the owner on May 24, 2019. It is now read-only.
/
new_examples.html
115 lines (110 loc) · 3.33 KB
/
new_examples.html
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
<title>Floodling</title>
<style>body { font-family: Helvetica, Arial, sans-serif; font-size: 16px; } </style>
<h1>Floodling Examples</h1>
Get the source code on <a href="//github.com/hyubs/floodling">GitHub</a>!
<form id="myForm">
<h3>Textbox</h3>
<p>
<input type="text" name="f1" id="myF1" />
</p>
<h3>Password</h3>
<p>
<input type="password" name="f2" />
</p>
<h3>Text Area</h3>
<p>
<textarea name="f3"></textarea>
</p>
<h3>Single Select (Dropdown)</h3>
<p>
<select name="f4">
<option>boo</option>
<option>foo</option>
<option>gloo</option>
<option>doo</option>
</select>
</p>
<h3>Multiple Select</h3>
<p>
<select name="f5[]" id="myMulti" multiple="multiple">
<option value="boo">boo</option>
<option value="foo">foo</option>
<option value="gloo">gloo</option>
<option value="doo">doo</option>
</select>
</p>
<h3>Radio Button Group</h3>
<p>
<input type="radio" name="f6" value="boo" /> boo<br />
<input type="radio" name="f6" value="foo" /> foo<br />
<input type="radio" name="f6" value="gloo" /> gloo<br />
<input type="radio" name="f6" value="doo" /> doo
</p>
<h3>Check Box</h3>
<p>
<input type="checkbox" name="f7a" value="boo" /> boo<br />
<input type="checkbox" name="f7b" value="foo" checked="checked" /> foo<br />
<input type="checkbox" name="f7c" value="gloo" /> gloo<br />
<input type="checkbox" name="f7d" value="doo" /> doo
</p>
<h3>Check Box Group</h3>
<p id="myCBG">
<input type="checkbox" name="f8[]" value="boo" /> boo<br />
<input type="checkbox" name="f8[]" value="foo" /> foo<br />
<input type="checkbox" name="f8[]" value="gloo" /> gloo<br />
<input type="checkbox" name="f8[]" value="doo" /> doo
</p>
<h3>Buttons - submit, reset, button</h3>
<p>
<input type="submit" name="f9" value="boo" />
<input type="reset" name="f10" value="boo" />
<input type="button" name="f11" value="boo" />
</p>
<h3>Image Button</h3>
<p>
<input type="image" name="f12" value="" />
</p>
<p> </p>
<p>Check <a href="//github.com/hyubs/floodling">GitHub</a> for a complete list of supported form elements.</p>
</form>
<script src="jquery.min.js"></script>
<script src="jquery.floodling.js"></script>
<script>
$(function() {
// You can use a selector for the specific element
$('#myF1').floodling('hello');
// Or, you can use a JSON object
$('#myForm').floodling({
f2: "foo2",
f3: "foo3",
f4: "foo"
});
$('#myForm').floodling('f6', 'gloo');
$('#myForm').floodling('f7b', 0);
$('#myForm').floodling('f7d', true);
$('#myForm').floodling('f9', 'doos');
$('#myForm').floodling('f10', 'door');
$('#myForm').floodling('f11', 'doob');
$('#myForm').floodling('f12', 'http://lorempixel.com/200/200/food/');
// ADDITIONAL TEST CASES
// MULTIPLE SELECT
//scope selector, JSON - selects boo, foo
$('#myForm').floodling({
'f5[]': ["boo","foo"]
});
//element selector, values only - deselects boo, selects gloo
$('#myMulti').floodling(['boo','gloo']);
//result: selected: foo, gloo
//scope selector, name and values - delesects foo, selects doo
$('#myForm').floodling('f5[]', ['foo','doo']);
//end result: selected: gloo, doo
// CHECKBOX
//scope selector: name and values - selects gloo, doo
$('#myForm').floodling('f8[]', ['gloo','doo']);
//scope selector: JSON - selects boo; deselects gloo
$('#myForm').floodling({
'f8[]': ["boo", "gloo"]
});
//result: boo, doo
});
</script>