-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
86 lines (76 loc) · 2.08 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Location Complete</title>
<style>
* {
box-sizing: border-box;
}
.container {
width: 300px;
margin: 100px auto;
}
input {
width: 100%;
display: block;
padding: 10px;
border: 1px solid #ccc;
outline: none;
font-size: 1.2em;
margin: 10px 0;
}
input:focus {
border: 1px solid #333;
}
.autocomplete-wrapper {
position: relative;
}
.lc-results-container {
width: 100%;
font-family: Arial, Helvetica, sans-serif;
padding: 0;
margin: 0;
background: #fefefe;
border: 1px solid #333;
margin-top: -1px;
position: absolute;
top: 100%;
}
.lc-result-item {
padding: 10px;
font-size: 1.2em;
list-style: none;
}
.lc-result-item.lc-focused {
background: #333;
color: white;
cursor: pointer;
}
</style>
</head>
<body>
<div class="container">
<form action="#" id="form">
<input placeholder="Name" type="text">
<div class="autocomplete-wrapper">
<input placeholder="Suburb or Postcode" type="text" id="locationcomplete" autocomplete="off">
</div>
<input placeholder="Phone" type="text">
<button id="submit" class="lcmpt-no-blur" type="submit">GO</button>
</form>
</div>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="locationcomplete.js"></script>
<script>
var complete = $('#locationcomplete').locationComplete({
url : 'postcodes.csv'
});
$('form').on('submit', function() {
complete.select();
console.log(complete.validate());
return false;
});
</script>
</body>
</html>