0151 355 4555

International Forms

You may have a drop-down list of countries as part of your address entry forms. Because the address validation service only provides UK data, the Ajax Address Validation script will auto-hide the "Find" button when a country other than the UK is selected.

To use this functionality, just set the expectedCountry option to the value that must be selected in this drop down list before the "Find" button is shown.

<select id="country">
  <option value="AF">Afghanistan</option>
  <option value="AX">Åland Islands</option>
  ...
  <option value="GB">United Kingdom</option>
  <option value="US">United States</option>
  ...
</select>

<script type="text/javascript">

new data8.postcodeLookupButton(
	[
		{ element: 'company', field: 'organisation' },
		{ element: 'address1', field: 'line1' },
		{ element: 'address2', field: 'line2' },
		{ element: 'address3', field: 'line3' },
		{ element: 'city', field: 'town' },
		{ element: 'county', field: 'county' },
		{ element: 'postcode', field: 'postcode' },
		{ element: 'country', field: 'country' }
	],
	{
		// Change this to your own Ajax key
		ajaxKey: 'your-ajax-key',

		// Change this to your postcode lookup license type
		license: 'WebClickFull',

		expectedCountry: 'GB'
	}
).show();

</script>