This repository was archived by the owner on Oct 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdemo.html
More file actions
74 lines (65 loc) · 2.44 KB
/
Copy pathdemo.html
File metadata and controls
74 lines (65 loc) · 2.44 KB
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
<!doctype html>
<html>
<meta charset="utf-8">
<head>
<title>DAWA autocomplete demo</title>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="bower_components/jquery-ui/themes/base/jquery-ui.css">
<link rel="stylesheet" href="bower_components/jquery-ui/themes/base/theme.css">
<link rel="stylesheet" href="bower_components/jquery-ui/themes/base/autocomplete.css">
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/jquery-ui/jquery-ui.js"></script>
<script src="bower_components/jquery-ui/ui/widgets/autocomplete.js"></script>
<script src="dawa-autocomplete.js"></script>
<body class="ui-widget">
<p><label for="adresse-autocomplete">Autocomplete af adresse</label></p>
<input type="text" id="adresse-autocomplete" style="width: 400px;">
<p>Valgt adresse: <span id="adresse-choice"></span></p>
<hr>
<p><label for="adgangsadresse-autocomplete">Autocomplete af adgangsadresse</label></p>
<input type="text" id="adgangsadresse-autocomplete" style="width: 400px;">
<p>Valgt adgangsadresse: <span id="adgangsadresse-choice"></span></p>
<hr>
<p><label for="adresse-autocomplete-kbh">Autocomplete af adresse i københavn</label></p>
<input type="text" id="adresse-autocomplete-kbh" style="width: 400px;">
<p>Valgt adresse: <span id="adresse-choice-kbh"></span></p>
<hr>
<p><label for="adresse-autocomplete-8000">Autocomplete af adresse i postnummer 8000 Aarhus C</label></p>
<input type="text" id="adresse-autocomplete-8000" style="width: 400px;">
<p>Valgt adresse: <span id="adresse-choice-8000"></span></p>
<hr>
</body>
<script>
$('#adresse-autocomplete').dawaautocomplete({
select: function(event, data) {
$('#adresse-choice').text(data.tekst);
},
error: function(xhr, status, error) {
alert('Der opstod en fejl: ' + status + " - " + error);
}
});
$('#adgangsadresse-autocomplete').dawaautocomplete({
adgangsadresserOnly: true,
select: function(event, data) {
$('#adgangsadresse-choice').text(data.tekst);
}
});
$('#adresse-autocomplete-kbh').dawaautocomplete({
params: {
kommunekode: 101
},
select: function(event, data) {
$('#adresse-choice-kbh').text(data.tekst);
}
});
$('#adresse-autocomplete-8000').dawaautocomplete({
params: {
postnr: 8000
},
select: function(event, data) {
$('#adresse-choice-8000').text(data.tekst);
}
});
</script>
</html>