-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.html
45 lines (36 loc) · 1.25 KB
/
test.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
<!DOCTYPE html>
<html>
<head></head>
<body>
<form id="form">
<input type="text" name="textInput" value="text input" />
<input type="password" name="passwordInput" value="password input" />
<input type="checkbox" name="checkbox1" />
<input type="checkbox" name="checkbox2" checked="checked" />
<input type="radio" name="radiogroup" value="first" />
<input type="radio" name="radiogroup" value="second" />
<input type="button" name="button" value="A button" />
<input type="hidden" name="multiple" value="a" />
<input type="hidden" name="multiple" value="b" />
<input type="hidden" name="multiple" value="c" />
<input type="hidden" name="test.nested" value="nested" />
<select name="select">
<option value="first">First</option>
<option value="second">Second</option>
</select>
<textarea name="textarea">Text area content</textarea>
<input type="submit" value="Serialize" />
</form>
<script src="build/build.js"></script>
<script>
var serialize = require('serialize')
, form = document.querySelector('#form')
;
form.onsubmit = function (e) {
console.log(serialize(form));
e.returnValue = false;
e.preventDefault();
};
</script>
</body>
</html>