-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathaddress-autocomplete-single-line.html
98 lines (95 loc) · 4.17 KB
/
address-autocomplete-single-line.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
<!DOCTYPE html>
<html>
<head>
<title>Address Lookup Single Line Form | Demo</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500">
<!-- only use if loadCss URL query attribute flag is set to false -->
<link type="text/css" rel="stylesheet prefetch" href="./css/addy.min.css">
<!-- or CDN -->
<!-- <link type="text/css" rel="stylesheet prefetch" href="https://www.addysolutions.com/address-lookup/1.6.2/css/addy.min.css"> -->
<style>
.awesomplete {
display: block !important;
}
body {
font-family: 'Roboto', sans-serif;
font-size: 10pt;
}
.field {
width: 300px;
}
.label {
width: 120px;
}
</style>
</head>
<body>
<form>
<table>
<tr>
<td class="label">Address</td>
<td><input type="text" class="field" id="address" placeholder="Enter an address.." auto-complete></td>
</tr>
<tr>
<td>Suburb</td>
<td><input type="text" class="field" id="suburb"></td>
</tr>
<tr>
<td>Town/City</td>
<td><input type="text" class="field" id="city"></td>
</tr>
<tr>
<td>Region</td>
<td>
<select id="region">
<option value="">Select a region ...</option>
<option value="301">Auckland</option>
<option value="303">Bay of Plenty</option>
<option value="312">Canterbury</option>
<option value="304">Gisborne</option>
<option value="305">Hawke's Bay</option>
<option value="307">Manawatu - Wanganui</option>
<option value="310">Marlborough</option>
<option value="315">Nelson</option>
<option value="300">Northland</option>
<option value="313">Otago</option>
<option value="314">Southland</option>
<option value="306">Taranaki</option>
<option value="309">Tasman</option>
<option value="302">Waikato</option>
<option value="308">Wellington</option>
<option value="311">West Coast</option>
</select>
</td>
</tr>
<tr>
<td>Postcode</td>
<td><input type="text" class="field" id="postcode"></td>
</tr>
</table>
</form>
<script type="text/javascript">
// This is the callback function to initialise the address lookup script
function initAddy() {
var addyComplete = new AddyComplete(document.getElementById("address"));
addyComplete.fields = {
address1: document.getElementById("address"),
suburb: document.getElementById("suburb"),
city: document.getElementById("city"),
postcode: document.getElementById("postcode"),
// region: document.getElementById("region") // NZ only
}
}
</script>
<!-- for NZ country -->
<script src="./js/addy.js?nzKey=addy-api-key&country=nz&callback=initAddy" async defer></script>
<!-- or CDN -->
<!-- <script src="https://www.addysolutions.com/address-lookup/1.6.2/js/addy.min.js?nzKey=demo-api-key&country=nz&callback=initAddy" async defer></script> -->
<!-- for AU country -->
<!-- <script src="https://www.addysolutions.com/address-lookup/1.6.2/js/addy.min.js?auKey=demo-api-key&country=au&callback=initAddy" async defer></script> -->
<!-- or CDN -->
<!-- <script src="./js/addy.min.js?auKey=demo-api-key&country=au&callback=initAddy" async defer></script> -->
</body>
</html>