-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
130 lines (121 loc) · 3.96 KB
/
example.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Gatekeeper Example</title>
<link rel="stylesheet" href="example.css">
<link rel="stylesheet" href="gatekeeper.css">
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<form action="" novalidate>
<section>
<header>Checkbox (checkbox)</header>
<label for="type-checkbox">On/Off</label>
<input type="checkbox" name="type-checkbox" value="a" id="type-checkbox" required>
</section>
<section>
<header>Checkbox Group (checkboxes with same name)</header>
<label for="type-checkboxgroup-a">A</label>
<input type="checkbox" name="type-checkboxgroup" value="a" id="type-checkboxgroup-a" required>
<label for="type-checkboxgroup-b">B</label>
<input type="checkbox" name="type-checkboxgroup" value="b" id="type-checkboxgroup-b" required>
<label for="type-checkboxgroup-c">C</label>
<input type="checkbox" name="type-checkboxgroup" value="c" id="type-checkboxgroup-c" required>
</section>
<section>
<header>Radio (radio)</header>
<label for="type-radio-a">A</label>
<input type="radio" name="type-radio" value="a" id="type-radio-a" required>
<label for="type-radio-b">B<l/abel>
<input type="radio" name="type-radio" value="b" id="type-radio-b" required>
<label for="type-radio-c">C</label>
<input type="radio" name="type-radio" value="c" id="type-radio-c" required>
</section>
<section>
<header>Select (select)</header>
<select name="type-select" required>
<option value="">Choose one</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
</section>
<section>
<header>Text Area (textarea)</header>
<textarea name="type-textarea" required></textarea>
</section>
<section>
<header>Text (text)</header>
<input type="text" name="type-text" required>
</section>
<section>
<header>Search (search)</header>
<input type="search" name="type-search">
</section>
<section>
<header>Telephone (tel)</header>
<input type="tel" name="type-tel">
</section>
<section>
<header>URL (url)</header>
<input type="url" name="type-url">
</section>
<section>
<header>Email (email)</header>
<input type="email" name="type-email">
</section>
<section>
<header>Date and Time (datetime)</header>
<input type="datetime" name="type-datetime">
</section>
<section>
<header>Date (date)</header>
<input type="date" name="type-date">
</section>
<section>
<header>Month (month)</header>
<input type="month" name="type-month">
</section>
<section>
<header>Week (week)</header>
<input type="week" name="type-week">
</section>
<section>
<header>Time (time)</header>
<input type="time" name="type-time">
</section>
<section>
<header>Local Date and Time (datetime-local)</header>
<input type="datetime-local" name="type-datetime-local">
</section>
<section>
<header>Number (number)</header>
<input type="number" name="type-number">
</section>
<section>
<header>Range (range)</header>
<input type="range" name="type-range">
</section>
<section>
<header>Color (color)</header>
<input type="color" name="type-color">
</section>
<section>
<input type="submit" value="Submit" name="submit">
</section>
</form>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="gatekeeper.js"></script>
<script>
$('form').on('submit', Gatekeeper.onValidSubmit(function(evt) {
alert('valid!');
}, function(evt) {
alert('invalid!');
}));
</script>
</body>
</html>