-
Notifications
You must be signed in to change notification settings - Fork 15
/
form-cc-example-m2.html
194 lines (177 loc) · 8.78 KB
/
form-cc-example-m2.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="author" content="Ido Green | greenido.wordpress.com | @greenido">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#db5945">
<title>Auto Complete Attribute Example</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.96.1/css/materialize.min.css">
<body>
<div class="container">
<div class="row jumbotron">
<h1>AutoComplete Example</h1>
<div class="col-md-4 col-xs-6">
<p>
<h4>Autofill in action</h4>
To try this example, open it in Chrome (version 42+) and try to start filling the fields. Chrome will suggest you 'auto fill' data from what it got so far.
<br></p>
</div>
<div class="col-md-4 col-xs-6">
<h4>Wallet Integration</h4>
If you got
<a href="http://google.com/wallet">Google Wallet</a>
with you credit card data, even better! Go to the
<a href="#paymentSec">'Payment' section</a>
and start to fill the data. Chrome will offer you to pre-fill it with the current credit card's information wallet got on file.
<br>
(!) The current spec:
<a href="https://html.spec.whatwg.org/multipage/forms.html#association-of-controls-and-forms">html.spec.whatwg.org/multipage/forms.html</a>
</div>
</div>
<div role="main">
<form method="post" id="usrForm" class="form-horizontal">
<fieldset>
<legend>Contact</legend>
<div class="form-group">
<label for="frmNameA" class="col-lg-2 control-label">Name</label>
<div class="col-lg-10">
<input name="name" id="frmNameA" class="form-control validate" placeholder="Full name" required autocomplete="name"></div>
</div>
<div class="form-group">
<label for="frmEmailA" class="col-lg-2 control-label">Email</label>
<div class="col-lg-10">
<input type="email" name="email" class="form-control validate" id="frmEmailA" placeholder="[email protected]" required autocomplete="email"></div>
</div>
<div class="form-group">
<label for="frmEmailC" class="col-lg-2 control-label">Confirm Email</label>
<div class="col-lg-10">
<input type="email" name="emailC" class="form-control validate" id="frmEmailC" placeholder="[email protected]" required autocomplete="email"></div>
</div>
<div class="form-group">
<label for="frmPhoneNumA" class="col-lg-2 control-label">Phone</label>
<div class="col-lg-10">
<input type="tel" name="phone" id="frmPhoneNumA" class="form-control validate" placeholder="+1-650-450-1212" required autocomplete="tel"></div>
</div>
</fieldset>
</form>
<div class="row">
<form class="col s12">
<fieldset>
<legend>Contact (version 2)</legend>
<p>The fields' name will move when the user click on them</p>
<div class="row">
<div class="input-field col s6">
<input id="first_name" type="text" class="validate" required autocomplete="fname">
<label for="first_name">First Name</label>
</div>
<div class="input-field col s6">
<input id="last_name" type="text" class="validate" required autocomplete="lname">
<label for="last_name">Last Name</label>
</div>
</div>
<div class="row">
<div class="input-field col s6">
<input name="frmEmailC" id="frmEmailA" type="text" class="validate" required autocomplete="email">
<label for="frmAddressB">Email</label>
</div>
</div>
<div class="row">
<div class="input-field col s6">
<input name="phone" id="frmPhone" type="text" class="" required autocomplete="tel">
<label for="frmAddressB">Phone</label>
</div>
</div>
</fieldset>
</form>
</div>
<form class="col s12">
<fieldset>
<legend>Shipping</legend>
<div class="form-group">
<label for="frmAddressS" class="active col-lg-2 control-label">Address</label>
<div class="col-lg-10">
<input name="ship-address" class="form-control validate" required id="frmAddressS" autocomplete="shipping street-address"></div>
</div>
<div class="form-group">
<label for="frmCityS" class="active col-lg-2 control-label">City</label>
<div class="col-lg-10">
<input name="ship-city" class="form-control validate" required id="frmCityS" placeholder="New York" autocomplete="shipping address-level2"></div>
</div>
<div class="form-group">
<label for="frmStateS" class="active col-lg-2 control-label">State</label>
<div class="col-lg-10">
<input name="ship-state" class="form-control validate" required id="frmStateS" placeholder="NY" autocomplete="shipping address-level1"></div>
</div>
<div class="form-group">
<label for="frmZipS" class="active col-lg-2 control-label">Zip</label>
<div class="col-lg-10">
<input name="ship-zip" class="form-control validate" required id="frmZipS" placeholder="10011" autocomplete="shipping postal-code"></div>
</div>
<div class="form-group">
<label for="frmCountryS" class="active col-lg-2 control-label">Country</label>
<div class="col-lg-10">
<input name="ship-country" class="form-control validate" required id="frmCountryS" placeholder="USA" autocomplete="shipping country"></div>
</div>
<div class="row">
<div class="col s6">
<input type="checkbox" class="filled-in" name="billAndShip" id="cbBillAndShip">
<label for="cbBillAndShip">Bill to this address</label>
</div>
</div>
</fieldset>
<div id="paymentSec">
<fieldset>
<legend>Payment</legend>
<p> <i class="large mdi-action-add-shopping-cart"></i>
Do <b>NOT</b>
provide real credit card information in this field.
</p>
<div class="form-group">
<label for="frmNameCC" class="col-lg-2 control-label">Name on card</label>
<div class="col-lg-10">
<input name="ccname" id="frmNameCC" class="form-control" required placeholder="Full Name" autocomplete="cc-name"></div>
</div>
<div class="form-group">
<label for="frmCCNum" class="col-lg-2 control-label">Card Number</label>
<div class="col-lg-10">
<input name="cardnumber" id="frmCCNum" class="form-control" required autocomplete="cc-number"></div>
</div>
<div class="form-group">
<label for="frmCCCVC" class="col-lg-2 control-label">CVC</label>
<div class="col-lg-10">
<input name="cvc" id="frmCCCVC" class="form-control" required autocomplete="cc-csc"></div>
</div>
<div class="form-group">
<label for="frmCCExp" class="col-lg-2 control-label">Expiry</label>
<div class="col-lg-10">
<input name="cc-exp" id="frmCCExp" class="form-control" required placeholder="MM-YYYY" autocomplete="cc-exp"></div>
</div>
<div class="container">
<div class="form-group">
<div class="col-lg-10 col-lg-offset-2">
<button class="btn btn-default">Cancel</button>
<button type="submit" id="butCheckout" class="btn btn-primary">Check Out</button>
</div>
</div>
</div>
</fieldset>
</div>
</form>
<!-- Compiled and minified JavaScript -->
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.96.1/js/materialize.min.js"></script>
<!-- GA -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-53348325-1', 'auto');
ga('require', 'displayfeatures');
ga('send', 'pageview');
</script>
</body>
</html>