Pattern
Ask for an address
Ask for the GhanaPostGPS digital address, directions in people's own words, the town and the region, and never force a street number or postcode.
When to use
- When you need to visit people, deliver something to them, or know which district office deals with them.
When not to use
- When you only need to know the region or district, such as to send people to the right office. Ask for that alone.
- When you will only contact people by phone, SMS or email. Only collect the personal data you need.
How it works
Ask for the address on one page, with the question as the page heading, such as "What is your address?"
- Digital address. The GhanaPostGPS address, in a medium-width box. Make it optional unless everyone using your service must have one.
- Address or directions. A text box where people describe where they live in their own words: house number and street if there are any, the area, and a landmark near it.
- Town or city. A text box.
- Region. A select with the 16 regions of Ghana, in alphabetical order.
Addresses in Ghana
- Many places do not have a street name or a house number. People give directions instead: "behind the Methodist church", "the blue gate after the filling station". Accept this as a full answer.
- Do not make house number or street required, and do not ask for a postcode or ZIP code. Address forms copied from other countries often do.
- Do not use an address form made for another country: it will ask for things people do not have, and reject what they do have.
- Where people live and where they get letters are different. A post office box (P.O. Box) is a postal address, not a home. Ask only for the one you need, and say which one you mean, such as "Where do you live?" or "What is your postal address?"
The digital address
- A GhanaPostGPS digital address is two letters, then numbers, such as GA-000-0000. Say this in the hint, with an example that is clearly not real.
- Tell people how to find theirs, such as in the GhanaPostGPS app, if they may not know it.
- Accept it with or without hyphens and spaces, and in capitals or small letters. Tidy it before you check it: remove spaces, change small letters to capitals, and put the hyphens back.
- Check its shape only: two letters, a hyphen, 3 or 4 digits, a hyphen and 4 digits. Do not reject an address because you do not recognise its letters.
- Do not make people use a map or share their location to find their address. It uses mobile data, does not work for everyone, and cannot be used with a screen reader. Offer it only as an extra.
- Add
autocomplete="off",spellcheck="false"andautocapitalize="characters". There is noautocompletevalue for a digital address, and browsers would fill in the wrong thing.
The other fields
- Use a textarea for "Address or directions", with
autocomplete="street-address". Give it at least 3 rows, and do not limit it to a few characters. - Add
autocomplete="address-level2"to the town or city, andautocomplete="address-level1"to the region. - Use a select for the region, because there are 16 of them: Ahafo, Ashanti, Bono, Bono East, Central, Eastern, Greater Accra, North East, Northern, Oti, Savannah, Upper East, Upper West, Volta, Western and Western North.
- Only ask for the district if you need it, and then as a select that depends on the region, on the next page.
- Show the address back on the check answers page as people wrote it, one part to a line.
Error messages
Use these messages in the error summary and next to the field.
- If the digital address is required and empty: "Enter your digital address, such as GA-000-0000".
- If the digital address is the wrong shape: "Enter a digital address in the right format, such as GA-000-0000".
- If the address or directions are empty: "Enter your address or directions to where you live".
- If the town or city is empty: "Enter your town or city".
- If no region is chosen: "Select your region".
Accessibility
- Follow the accessibility advice in the ask for information pattern: a unique page title, the question as the heading, and a Back link.
- Give every field its own visible label. Do not use one label for several boxes.
- Mark optional fields with "(optional)" in the label, rather than marking required fields with a star.
Example: An address question page
<p><a href="/apply/phone/">Back</a></p>
<h1>What is your address?</h1>
<form action="/apply/check/" method="post" novalidate>
<div class="ggds-field">
<label class="ggds-label" for="address-digital">Digital address (optional)</label>
<p class="ggds-hint" id="address-digital-hint">Your GhanaPostGPS address. It is two letters, then numbers, such as GA-000-0000.</p>
<input class="ggds-input ggds-input--width-medium" id="address-digital" name="digitalAddress" type="text" autocomplete="off" spellcheck="false" autocapitalize="characters" aria-describedby="address-digital-hint">
</div>
<div class="ggds-field">
<label class="ggds-label" for="address-directions">Address or directions</label>
<p class="ggds-hint" id="address-directions-hint">The house number and street if there are any, the area, and a landmark near it, such as a school, church or mosque.</p>
<textarea class="ggds-textarea" id="address-directions" name="directions" rows="4" autocomplete="street-address" aria-describedby="address-directions-hint"></textarea>
</div>
<div class="ggds-field">
<label class="ggds-label" for="address-town">Town or city</label>
<input class="ggds-input ggds-input--width-long" id="address-town" name="town" type="text" autocomplete="address-level2">
</div>
<div class="ggds-field">
<label class="ggds-label" for="address-region">Region</label>
<select class="ggds-select" id="address-region" name="region" autocomplete="address-level1">
<option value="">Choose a region</option>
<option>Ahafo</option>
<option>Ashanti</option>
<option>Bono</option>
<option>Bono East</option>
<option>Central</option>
<option>Eastern</option>
<option>Greater Accra</option>
<option>North East</option>
<option>Northern</option>
<option>Oti</option>
<option>Savannah</option>
<option>Upper East</option>
<option>Upper West</option>
<option>Volta</option>
<option>Western</option>
<option>Western North</option>
</select>
</div>
<button class="ggds-button" type="submit">Continue</button>
</form><>
<p><a href="/apply/phone/">Back</a></p>
<h1>What is your address?</h1>
<form action="/apply/check/" method="post" noValidate>
<div className="ggds-field">
<label className="ggds-label" htmlFor="address-digital">Digital address (optional)</label>
<p className="ggds-hint" id="address-digital-hint">Your GhanaPostGPS address. It is two letters, then numbers, such as GA-000-0000.</p>
<input className="ggds-input ggds-input--width-medium" id="address-digital" name="digitalAddress" type="text" autoComplete="off" spellCheck="false" autocapitalize="characters" aria-describedby="address-digital-hint" />
</div>
<div className="ggds-field">
<label className="ggds-label" htmlFor="address-directions">Address or directions</label>
<p className="ggds-hint" id="address-directions-hint">The house number and street if there are any, the area, and a landmark near it, such as a school, church or mosque.</p>
<textarea className="ggds-textarea" id="address-directions" name="directions" rows={4} autoComplete="street-address" aria-describedby="address-directions-hint"></textarea>
</div>
<div className="ggds-field">
<label className="ggds-label" htmlFor="address-town">Town or city</label>
<input className="ggds-input ggds-input--width-long" id="address-town" name="town" type="text" autoComplete="address-level2" />
</div>
<div className="ggds-field">
<label className="ggds-label" htmlFor="address-region">Region</label>
<select className="ggds-select" id="address-region" name="region" autoComplete="address-level1">
<option value="">Choose a region</option>
<option>Ahafo</option>
<option>Ashanti</option>
<option>Bono</option>
<option>Bono East</option>
<option>Central</option>
<option>Eastern</option>
<option>Greater Accra</option>
<option>North East</option>
<option>Northern</option>
<option>Oti</option>
<option>Savannah</option>
<option>Upper East</option>
<option>Upper West</option>
<option>Volta</option>
<option>Western</option>
<option>Western North</option>
</select>
</div>
<button className="ggds-button" type="submit">Continue</button>
</form>
</>Example: An address page after a failed submit
<p><a href="/apply/phone/">Back</a></p>
<div class="ggds-error-summary" data-ggds-module="error-summary" role="alert" aria-labelledby="address-error-title" tabindex="-1">
<h2 class="ggds-error-summary__title" id="address-error-title">There is a problem</h2>
<ul class="ggds-error-summary__list">
<li><a href="#address-error-digital">Enter a digital address in the right format, such as GA-000-0000</a></li>
</ul>
</div>
<h1>What is your address?</h1>
<form action="/apply/check/" method="post" novalidate>
<div class="ggds-field ggds-field--error">
<label class="ggds-label" for="address-error-digital">Digital address (optional)</label>
<p class="ggds-hint" id="address-error-digital-hint">Your GhanaPostGPS address. It is two letters, then numbers, such as GA-000-0000.</p>
<p class="ggds-error-message" id="address-error-digital-error"><span class="ggds-visually-hidden">Error:</span> Enter a digital address in the right format, such as GA-000-0000</p>
<input class="ggds-input ggds-input--width-medium" id="address-error-digital" name="digitalAddress" type="text" autocomplete="off" spellcheck="false" autocapitalize="characters" aria-invalid="true" aria-describedby="address-error-digital-hint address-error-digital-error" value="GA-00-000">
</div>
<div class="ggds-field">
<label class="ggds-label" for="address-error-directions">Address or directions</label>
<p class="ggds-hint" id="address-error-directions-hint">The house number and street if there are any, the area, and a landmark near it, such as a school, church or mosque.</p>
<textarea class="ggds-textarea" id="address-error-directions" name="directions" rows="4" autocomplete="street-address" aria-describedby="address-error-directions-hint">House 0, opposite the district hospital</textarea>
</div>
<div class="ggds-field">
<label class="ggds-label" for="address-error-town">Town or city</label>
<input class="ggds-input ggds-input--width-long" id="address-error-town" name="town" type="text" autocomplete="address-level2" value="Example Town">
</div>
<div class="ggds-field">
<label class="ggds-label" for="address-error-region">Region</label>
<select class="ggds-select" id="address-error-region" name="region" autocomplete="address-level1">
<option value="">Choose a region</option>
<option>Ahafo</option>
<option>Ashanti</option>
<option>Bono</option>
<option>Bono East</option>
<option>Central</option>
<option selected>Eastern</option>
<option>Greater Accra</option>
<option>North East</option>
<option>Northern</option>
<option>Oti</option>
<option>Savannah</option>
<option>Upper East</option>
<option>Upper West</option>
<option>Volta</option>
<option>Western</option>
<option>Western North</option>
</select>
</div>
<button class="ggds-button" type="submit">Continue</button>
</form><>
<p><a href="/apply/phone/">Back</a></p>
<div className="ggds-error-summary" data-ggds-module="error-summary" role="alert" aria-labelledby="address-error-title" tabIndex={-1}>
<h2 className="ggds-error-summary__title" id="address-error-title">There is a problem</h2>
<ul className="ggds-error-summary__list">
<li><a href="#address-error-digital">Enter a digital address in the right format, such as GA-000-0000</a></li>
</ul>
</div>
<h1>What is your address?</h1>
<form action="/apply/check/" method="post" noValidate>
<div className="ggds-field ggds-field--error">
<label className="ggds-label" htmlFor="address-error-digital">Digital address (optional)</label>
<p className="ggds-hint" id="address-error-digital-hint">Your GhanaPostGPS address. It is two letters, then numbers, such as GA-000-0000.</p>
<p className="ggds-error-message" id="address-error-digital-error"><span className="ggds-visually-hidden">Error:</span> Enter a digital address in the right format, such as GA-000-0000</p>
<input className="ggds-input ggds-input--width-medium" id="address-error-digital" name="digitalAddress" type="text" autoComplete="off" spellCheck="false" autocapitalize="characters" aria-invalid="true" aria-describedby="address-error-digital-hint address-error-digital-error" defaultValue="GA-00-000" />
</div>
<div className="ggds-field">
<label className="ggds-label" htmlFor="address-error-directions">Address or directions</label>
<p className="ggds-hint" id="address-error-directions-hint">The house number and street if there are any, the area, and a landmark near it, such as a school, church or mosque.</p>
<textarea className="ggds-textarea" id="address-error-directions" name="directions" rows={4} autoComplete="street-address" aria-describedby="address-error-directions-hint">House 0, opposite the district hospital</textarea>
</div>
<div className="ggds-field">
<label className="ggds-label" htmlFor="address-error-town">Town or city</label>
<input className="ggds-input ggds-input--width-long" id="address-error-town" name="town" type="text" autoComplete="address-level2" defaultValue="Example Town" />
</div>
<div className="ggds-field">
<label className="ggds-label" htmlFor="address-error-region">Region</label>
<select className="ggds-select" id="address-error-region" name="region" autoComplete="address-level1">
<option value="">Choose a region</option>
<option>Ahafo</option>
<option>Ashanti</option>
<option>Bono</option>
<option>Bono East</option>
<option>Central</option>
<option defaultSelected>Eastern</option>
<option>Greater Accra</option>
<option>North East</option>
<option>Northern</option>
<option>Oti</option>
<option>Savannah</option>
<option>Upper East</option>
<option>Upper West</option>
<option>Volta</option>
<option>Western</option>
<option>Western North</option>
</select>
</div>
<button className="ggds-button" type="submit">Continue</button>
</form>
</>Components used
Something wrong, unclear or missing? or suggest a change to it on GitHub. You need a GitHub account.