-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHRA_SampleClient
More file actions
43 lines (35 loc) · 1.91 KB
/
HRA_SampleClient
File metadata and controls
43 lines (35 loc) · 1.91 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
<input type="text" id="rapidAddress" size="40" placeholder="Type in address here" />
<div id="error"></div>
<br />
<div><input id="HRA_ID" name="HRA_ID" placeholder="ID (DPID or GNAF PID)" size="40" type="text"/></div>
<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<!-- you can download the following js from our website -->
<script src="https://s3-ap-southeast-2.amazonaws.com/common.mastersoftgroup.com/scripts/harmony-1.6.7.min.js" type="text/javascript"></script>
<script src="https://s3-ap-southeast-2.amazonaws.com/common.mastersoftgroup.com/scripts/harmony-ui-1.6.7.min.js" type="text/javascript"></script>
<script>
$(function() {
// Use the environment based on the site it is on
Harmony.useEnv("https://hosted.mastersoftgroup.com");
// Init the client with the demo api user name and credential
// We have created the following user and credential which you can use on localhost
Harmony.init("", "", Harmony.AUSTRALIA);
// Use the JSONP protocol
Harmony.useProtocol(Harmony.JSONP);
var opt = {
// min 3 chars to trigger the lookup
minLength:3,
// skip transaction call when address selected. You need to make your own call depending on your business flow.
skipTransaction: false,
// define your own call back function when address selected.
onSelect: function(event, ui) {
// console.log('address selected: ' + ui.item.fullAddress);
}
};
// Configure the address lookup.
// "#rapidAddress" is referring to the input address element id
Harmony.UI.addressLookup($("#rapidAddress"), "AUPAF", opt);
Harmony.UI.addField(Harmony.ID, $("#HRA_ID"));
});
</script>