
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
jquery-postcodes
Advanced tools
Add UK address lookups with a simple postcode input field on any web form with the Ideal-Postcodes.co.uk API. Ideal Postcodes uses Royal Mail's addressing database, the Postcode Address File (PAF).
Add UK address lookups with a simple postcode input field on any web form with the Ideal-Postcodes.co.uk API. Ideal Postcodes uses Royal Mail's addressing database, the Postcode Address File (PAF).
PAF is licensed from the Royal Mail and incurs a license fee per lookup. We make PAF available to the public at 2p per external lookup.
This plugin creates an input field to lookup postcodes on the Ideal Postcodes API. If your user searches a valid postcode, a dropdown menu is displayed and the selected address is piped into appropriate fields.
The plugin provides addresses according to Royal Mail's Addressing Guidelines. This consists of 3 address lines, a Post Town and Postcode and is sufficient to uniquely identify a premise in the UK.
<script src="jquery.js"></script>
<script src="jquery.postcodes.min.js"></script>
Sign up to get an API key
Setup a Postcode Search Field by inserting an empty div tag and calling .setupPostcodeLookup()
. Pass in a configuration object identifying specifying your API Key and address fields (using CSS selectors)
<div id="postcode_lookup_field"></div>
<script>
$('#postcode_lookup_field').setupPostcodeLookup({
// Set your API key
api_key: 'ak_Iddqd8Idkfa7Idchoppers8',
// Pass in CSS selectors pointing to your input fields to pipe the results
output_fields: {
line_1: '#first_line',
line_2: '#second_line',
line_3: '#third_line',
post_town: '#post_town',
postcode: '#postcode'
}
});
</script>
You can extract more information on each address by passing additional properties into the output_fields object. The complete list of available data fields can be found here.
You can also configure the css classes of the generated lookup elements for custom styling. Read our documentation to find out more. Or play with a jsFiddle to familiarise yourself.
More documentation can be found at ideal-postcodes.co.uk
Run automated tests with
grunt test
This plugin has been tested against jQuery 1.7.x, 1.8.x, 1.9.x, 1.10.x, 1.11.x, 2.0.x and 2.1.x.
Our test postcodes are:
MIT
v1.2.1
v1.2.0
v1.1.2
FAQs
Add UK address lookups with a simple postcode input field on any web form with the Ideal-Postcodes.co.uk API. Ideal Postcodes uses Royal Mail's addressing database, the Postcode Address File (PAF).
The npm package jquery-postcodes receives a total of 116 weekly downloads. As such, jquery-postcodes popularity was classified as not popular.
We found that jquery-postcodes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.