forked from toddmotto/required-fallback
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
111 lines (104 loc) · 3.94 KB
/
index.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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HTML5 required attribute fallback with jQuery by @toddmotto | toddmotto.com</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="author" content="@toddmotto">
<link href="css/main.css" rel="stylesheet">
<link href="css/demo.css" rel="stylesheet">
</head>
<body>
<div class="header">
<div class="logo">
<a href="http://toddmotto.com" target="_blank">
<img src="img/logo.png" alt="Logo" class="logo-img">
</a>
</div>
<ul class="demo-nav">
<li class="demo-nav-link">
<a href="http://toddmotto.com/progressively-enhancing-html5-forms-creating-a-required-attribute-fallback-with-jquery">Go to tutorial</a>
</li>
</ul>
</div>
<div class="wrapper">
<div class="main">
<!-- note -->
<div class="note">
<p class="form-desc">
A robust HTML5 'required' attribute fallback, client-side jQuery script.
</p>
</div>
<!-- /note -->
<!-- Form -->
<form class="form" action="index.html" method="post">
<div class="form-row">
<label for="name" class="form-label">Name *</label>
<div class="form-field">
<input id="name" name="name" placeholder="Please enter your name" type="text" required
data-fb-ph-title-use="false" data-fb-desc-location="after">
</div>
</div>
<div class="form-row">
<label for="email" class="form-label">Email *</label>
<div class="form-field">
<input id="email" name="email" placeholder="Please enter your email address" type="email" required>
</div>
</div>
<div class="form-row">
<label for="radio" class="form-label">Radio Buttons *</label>
<div class="form-field">
<span class="form-radios">Select 1: </span>
<input id="radio" name="radiobutton" value="selection-one" type="radio" required>
<span class="form-radios">Select 2: </span>
<input name="radiobutton" value="selection-two" type="radio">
</div>
</div>
<div class="form-row">
<label for="checkbox" class="form-label">Checkboxes *</label>
<div class="form-field">
<span class="form-radios">Select 1: </span>
<input id="checkbox" name="checkbox" type="checkbox" required>
<span class="form-radios">Select 2: </span>
<input name="checkbox" type="checkbox">
</div>
</div>
<div class="form-row">
<label for="tel" class="form-label">Telephone *</label>
<div class="form-field">
<input id="tel" name="telephone" placeholder="Please enter your number" type="tel" required>
</div>
</div>
<div class="form-row">
<label for="website" class="form-label">Website *</label>
<div class="form-field">
<input id="website" name="website" placeholder="Begin with http://" type="url" required>
</div>
</div>
<div class="form-row">
<label for="message" class="form-label">Message *</label>
<div class="form-field">
<textarea id="message" name="message" placeholder="Include all the details you can" required></textarea>
</div>
</div>
<div class="form-row">
<button name="submit" type="submit" class="form-submit">Send Email</button>
</div>
</form>
<!-- /Form -->
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script> if(!window.jQuery) document.write('<script src="js/vendor/jquery-1.9.1.min.js"><\/script>');</script>
<script src="js/html5-fallback.js"></script>
<!-- Demo Analytics TODO remove, if todd's license allows it -->
<script>
var _gaq=[['_setAccount','UA-20440416-10'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src='//www.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)})(document,'script');
</script>
<!-- Demo Ads -->
<script src="http://toddmotto.com/ads/ads.js"></script>
</body>
</html>