This repository has been archived by the owner on May 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
address-autocomplete-typical.html
65 lines (65 loc) · 2.36 KB
/
address-autocomplete-typical.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
<!DOCTYPE html>
<html>
<head>
<title>Autocomplete Address 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">
<link type="text/css" rel="stylesheet prefetch" href="https://cdnjs.cloudflare.com/ajax/libs/awesomplete/1.1.2/awesomplete.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 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 autocomplete 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="/scripts/autocomplete/2.1.0/addycomplete.min.js?key=YOUR-ADDY-KEY&callback=initAddy" async defer></script>
</body>
</html>