Autoaddress jQuery Plugin Instance Functions

Once the Autoaddress jQuery Plugin is initialized on your page you have several extra functions available to your plugin instance to add extra flexibility.

You can use these functions at any time after the plugin in initialized, i.e. in a Callback Event, page load, button clicks, etc..

There are two ways you can invoke the functions which is shown in the example below, you can just prefer the syntax you prefer.


How to call the Functions

$("#myDiv").AutoAddress({ 
   key : "YOUR_KEY"
})

//Calling Instance Functions Syntax #1
$('#myDiv').AutoAddress('setAddress','Sample Address');
$('#myDiv').AutoAddress('setLanguage','GA');
$('#myDiv').AutoAddress('setCountry','IE');
$('#myDiv').AutoAddress('setProfileName','MyProfile');
$('#myDiv').AutoAddress('setLimit',"10");
$('#myDiv').AutoAddress('setGeographicAddress',true);
$('#myDiv').AutoAddress('setVanityMode',true);
$('#myDiv').AutoAddress('setAddressElements',true);
$('#myDiv').AutoAddress('setDefaultState');
$('#myDiv').AutoAddress('setLabel', 'placeHolderLabel', 'Enter Full Address or Postcode');
$('#myDiv').AutoAddress('showAutocomplete');
$('#myDiv').AutoAddress('clearAddress');
//Calling Instance Functions Syntax #2
$('#myDiv').AutoAddress().setAddress('Sample Address');
$('#myDiv').AutoAddress().setLanguage('GA');
$('#myDiv').AutoAddress().setCountry('IE');
$('#myDiv').AutoAddress().setProfileName('MyProfile');
$('#myDiv').AutoAddress().setGeographicAddress(true);
$('#myDiv').AutoAddress().setVanityMode(true);
$('#myDiv').AutoAddress().setAddressElements(true);
$('#myDiv').AutoAddress().setLimit('10');
$('#myDiv').AutoAddress().set​Label('placeHolderLabel', 'Enter Full Address or Postcode');
$('#myDiv').AutoAddress().showAutocomplete();
$('#myDiv').AutoAddress().clearAddress();

Function List

Function Name Description
setAddress(string) When invoked will set the Address value (string) as the value for the search input field.
setLanguage(string) Change the language to be used by the plugin. Available languages are "EN" and "GA"
setCountry(string) Change the country search for the plugin. Available countries are "IE" and "GB"
setProfileName(string) Enable your custom address profile when called.
setLimit(string) Control the number of options to be returned from your searches.
setGeographicAddress(boolean) To use geographic address format for results.
setVanityMode(boolean) To use vanity address format for results, if available.
setAddressElements(boolean) Turn on or off address elements.
setDefaultState() Restore the default state of the plugin, removing options / message containers etc.
setLabel(string, string) Change label text.
showAutocomplete() Show Autocomplete for the address or postcode in the search input field.
clearAddress() When invoked will clear the search input field.