|
About TerraPages AddressHelper
|
|
AddressHelper is a feature packed web based application component that can be used to obtain addresses which are validated against the G-NAF dataset. Besides validating addresses against the G-NAF dataset, AddressHelper can:
To use AddressHelper in your web application, all you need to do is add the folowing into a new HTML page.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript" src="InitAddressHelper.js"></script>
<script type="text/javascript" src="AddressHelper.js"></script>
<title>TerraPages Address Helper</title>
</head>
<body>
<div id="AddressHelper"></div>
<script>
var addressHelper = new AddressHelper();
addressHelper.setDisplay('INLINE');
addressHelper.setState(true, 'visible', '');
addressHelper.setSuburb(true, 'visible', '');
addressHelper.setStreetName(true, 'visible', '');
addressHelper.setStreetType(true, 'visible', '');
addressHelper.setStreetNumber(true, 'visible', '');
addressHelper.setFlatNumber(true, 'visible', '');
addressHelper.setAutoTab(true);
addressHelper.setLayout('VERTICAL');
addressHelper.setDelay(1.5);
addressHelper.setAlias(true);
addressHelper.setCoordinates(true);
addressHelper.setXMLResponse(true, '_blank');
addressHelper.setNumberAddressesReturned(10, 100);
addressHelper.setDimensions(400, 500);
addressHelper.setClearButton(true);
addressHelper.setStyle('http://www.mywebsite.com/css/addresshelper-main.css');
addressHelper.setFreeForm(true, 10, '<flatnumber>/<streetnumber> <streetname>
<streettype>, <suburb>, <state>');
addressHelper.setShowAllAddresses(true);
addressHelper.create();
</script>
</body>
</html>
The InitAddressHelper and AddressHelper scripts location will be made available to end users once they have purchased the product. These two scripts initialise the product and dynamically
creates the web application for you based on how you have configured the application.Inside the body of the HTML page that needs to be created, there needs to be a DIV with an ID of "AddressHelper like the following: <div id="AddressHelper"></div>Under this, some JavaScript needs to be inserted to place some dynamic HTML in the DIV and display to the user the AddressHelper application. Firstly, you need to create a new instance of the application by inserting the following line: var addressHelper = new AddressHelper();Once this is done, the user is then free to set options to their liking. If the user does not set anything, then the application will use defaults. However, if the user wants to change some of the settings, then the user can change the values passed in the parameters:
addressHelper.setDisplay('INLINE');
addressHelper.setState(true, 'visible', '');
addressHelper.setSuburb(true, 'visible', '');
addressHelper.setStreetName(true, 'visible', '');
addressHelper.setStreetType(true, 'visible', '');
addressHelper.setStreetNumber(true, 'visible', '');
addressHelper.setFlatNumber(true, 'visible', '');
addressHelper.setAutoTab(true);
addressHelper.setLayout('VERTICAL');
addressHelper.setDelay(1.5);
addressHelper.setAlias(true);
addressHelper.setCoordinates(true);
addressHelper.setXMLResponse(true, '_blank');
addressHelper.setNumberAddressesReturned(10, 100);
addressHelper.setDimensions(400, 500); // POPUP ONLY
addressHelper.setClearButton(true);
addressHelper.setStyle('http://www.mywebsite.com/css/addresshelper-main.css');
addressHelper.setFreeForm(true, 10,
'<flatnumber>/<streetnumber> <streetname> <streettype>, <suburb>, <state>');
addressHelper.setShowAllAddresses(true);
addressHelper.setCopyToParent(true); // POPUP and FLOATING ONLY
addressHelper.create();If you decide to load AddressHelper into a popup window, you needs to add the following line to your exising webpage where you want to launch AddressHelper from.
<script>
function launchAddressHelper() {
window.open('addresshelper.html', 'AddressHelper',
'resizable=yes,scrollbars=no,status=no,toolbar=no');
}
</script>
'addresshelper.html' is the new HTML page that you have just created.The user also needs to add a link to call this JavaScript function. This can be achieved via a text link like the following: <a href="javascript:void(0);" onclick="launchAddressHelper()"/>or via an image link like the following: <img src="addresshelper_logo.gif" onclick="launchAddressHelper()"/>This GIF will be supplied upon purchase. If however, you chose FLOATING as your preferred method, you need to create some text or an image with a certain ID. For example: <img id="DisplayAddressHelper" src="addresshelper-logo.gif" alt="Launch Address Helper" />Once clicked, your application will be displayed. You can either manually change the CSS for the AddressHelper DIV and display the application is an exact position, else the application will be displayed where the DIV is located. For INLINE, the application will be displayed where you have defined the AddressHelper DIV. Once all this is done, you should have a fully functional working AddressHelper product. Enjoy! |