Configure the script in Greasemonkey
In Firefox, open the Greasemonkey manager by right-clicking on the monkey in the bottom right and selecting "Manage User Scripts".
Select the PostcodeLookup script in the list on the left, and click "Add..." in the "Included Pages" section. Enter the address of the
page you want to use the Postcode Lookup script with, and click OK.
With the PostcodeLookup script still selected, click the "Edit" button in the bottom left corner. The first time you use this, you
will be prompted to select a program to use to edit the script with. If you don't have a preferred editor, you can use Notepad
(C:\Windows\Notepad.exe).
When the script is opened in the selected editor, you will see the following lines near the top:
var pageConfigs = new Array();
var ajaxKey = 'YOUR-AJAX-KEY';
The first thing you will need to change is to replace the 'YOUR-AJAX-KEY' option with your own Ajax key. You can generate this
at the Ajax key admin page - when generating the key, enter the domain name of the page
you want to use this script with.
Secondly, you will need to add an entry to the pageConfigs list to indicate where the various parts of the address should be
stored in the page. To do this, add some new code following the template below:
pageConfigs['http://www.example.com/'] = {
buttonPos: 'zipcode',
add1: 'address1',
add2: 'address2',
add3: 'address3',
add4: 'address4',
town: 'city',
county: 'state',
postcode: 'zipcode'
};
- Replace the URL http://www.example.com/ with the address of the page you want to use the script with.
- Change the
buttonPos setting to the ID of the element in the page to display the "Find Address" button after.
- Change the
add1 to add6 settings to the IDs of the elements in the page to hold the address lines after an address has been selected.
- If the town is required to be held in a specific field, use the
town setting instead of add5.
- If the county is required to be held in a specific field, use the
county setting instead of add6.
- Change the
postcode setting to the ID of the element in the page to hold the postcode.