forked from addynz/Address-Lookup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddress-lookup-standard.html
62 lines (62 loc) · 2.31 KB
/
address-lookup-standard.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
<!DOCTYPE html>
<html>
<head>
<title>Autocomplete Address Lookup Example | Addy.co.nz</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">
<link type="text/css" rel="stylesheet prefetch" href="https://addycdn.azureedge.net/neatcomplete/2.1.0/addycomplete.min.css">
<style>
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 Line 1</td>
<td><input type="text" class="field" id="address1" placeholder="Start typing an address.." auto-complete></td>
</tr>
<tr>
<td>Address Line 2</td>
<td><input type="text" class="field" id="address2"></td>
</tr>
<tr>
<td>Suburb</td>
<td><input type="text" class="field" id="suburb"></td>
</tr>
<tr>
<td>City</td>
<td><input type="text" class="field" id="city"></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("address1"));
addyComplete.fields = {
address1: document.getElementById("address1"),
address2: document.getElementById("address2"),
suburb: document.getElementById("suburb"),
city: document.getElementById("city"),
postcode: document.getElementById("postcode")
}
}
</script>
<script src="https://addycdn.azureedge.net/neatcomplete/2.1.0/addycomplete.min.js?key=YOUR-ADDY-KEY&callback=initAddy" async defer></script>
</body>
</html>