Overview
Help users provide an address using one of the following:
- Address lookup
- Multiple text inputs
Address lookup
An address lookup helps users find a full address from partial information such as a postcode.
Use an address lookup when you are asking users for a UK address.
How an address lookup works
An address lookup lets users specify a UK address by entering their postcode and selecting their address from a list.
When using an address lookup, you should:
- make it clear that it will only work for UK addresses
- provide a manual option for people with addresses that are missing or not properly listed in the address lookup
- let people enter their postcodes in upper or lower case and with or without spaces
Multiple text inputs
Only use multiple text inputs when an address lookup isn’t available or for customers with addresses that are missing or not properly listed in the address lookup.
Using multiple text inputs means:
- you can easily extract and use specific parts of an address
- you can give help for individual text inputs
- you can validate each part of the address separately
- users can complete the form using their browser’s autocomplete function
The disadvantages of using multiple text inputs are that:
- it is hard to find a single format that works for all addresses
- there is no guarantee that users will use the text inputs the way you think they will
- users cannot easily paste addresses from their clipboards
How multiple text inputs work
If you use multiple text inputs, you should:
- only make individual text inputs mandatory if you really need the information
- make the text inputs the appropriate length for the content – it helps people understand the form, for example, make postcode text inputs shorter than street text inputs
- let users enter postcodes in different formats
Make sure there are enough text inputs to accommodate longer addresses if you know your users will need them. For example, allow users to include a company name or flat number.
Make it optional for users to enter their county (such as Berkshire or Cumbria). It’s not part of a correct UK address, according to Royal Mail, and it’s not used to deliver post.
Remove the county field if you’re sure your users will not need it, and your service will not use it.
Things to remember
Allow different postcode formats
It’s easier for users if you accept and ignore unwanted characters. This is better than rejecting the input and telling the user they have not provided a valid postcode.
You should let users enter postcodes that contain:
- upper and lowercase letters
- no spaces
- additional spaces at the beginning, middle or end
- punctuation like hyphens, brackets, dashes and full stops
Use the autocomplete attribute on multiple address fields
Use the “autocomplete” attribute on each individual address field to help users enter their address more quickly. This lets you specify each input’s purpose so browsers can autofill the information on a user’s behalf if they have entered it previously.