Pattern
Ask for information with a form
Break a form into short pages, let people check their answers, and tell them what happens next.
When to use
- For any service that asks people for information: a complaint, an application, a registration, a request.
When not to use
- For a search or a single question on a page, such as a newsletter sign-up. Use one field and a button.
How it works
- Start page. What the service is for, who can use it, what people need before they start (a Ghana Card, a receipt) and how long it takes. One "Start now" button.
- Question pages. One question, or a few closely related ones, per page. The question is the page's heading.
- Check your answers. Every answer in a summary list, each with a "Change" link, and the declaration, then the button that sends it.
- Confirmation. A confirmation panel that says it worked and gives the reference number, then what happens next and when, and how to get in touch.
Questions
- Ask only what you need, and say why if it is not obvious, such as "We use your phone number only to call you about this complaint".
- Ask in the words people use. "Which network are you complaining about?", not "Select operator".
- Use radios for one choice from a short list, checkboxes for several, and a text input sized to the answer.
- Add
autocompleteto names, phone numbers, emails and addresses. - Do not ask for the same thing twice. Keep answers when people go back.
Errors
- Check the answers when the page is sent, not while people type.
- Show the error summary at the top, the message next to each field, and start the page title with "Error: ". With Django,
{{ form }}and the GGDS form renderer do all three. - Say how to fix it: "Enter a mobile number with 10 digits, like 024 000 0000".
- Keep what people entered, even when it is wrong, so they can correct it.
Confirmation
- Give a reference number people can quote, and send it by SMS or email too.
- Say what happens next and how long it takes, in working days.
- Say how to contact you about it.
Accessibility
- Give every page a unique title that starts with its question, such as "How should we contact you? – Make a complaint – Example Agency".
- Do not time people out without warning. If you must, warn them first and let them ask for more time.
- Let people go back without losing answers: a link at the top of each question page, and the browser's Back button.
- Make a question the page heading by putting an
<h1>inside the<legend>(withggds-fieldset__legend--page), or the<label>inside an<h1>(withggds-label--page), so screen readers hear it once.
Example: A question page
<p><a href="/complaints/start/">Back</a></p>
<form action="/complaints/details/" method="post" novalidate>
<div class="ggds-field">
<fieldset class="ggds-fieldset" aria-describedby="network-hint">
<legend class="ggds-fieldset__legend ggds-fieldset__legend--page"><h1>Which network are you complaining about?</h1></legend>
<p class="ggds-hint" id="network-hint">If it is about more than one, make a complaint for each.</p>
<div class="ggds-choices">
<div class="ggds-choice"><input class="ggds-choice__input" id="network-mtn" name="network" type="radio" value="mtn"><label class="ggds-choice__label" for="network-mtn">MTN</label></div>
<div class="ggds-choice"><input class="ggds-choice__input" id="network-telecel" name="network" type="radio" value="telecel"><label class="ggds-choice__label" for="network-telecel">Telecel</label></div>
<div class="ggds-choice"><input class="ggds-choice__input" id="network-at" name="network" type="radio" value="at"><label class="ggds-choice__label" for="network-at">AT</label></div>
<div class="ggds-choice"><input class="ggds-choice__input" id="network-other" name="network" type="radio" value="other"><label class="ggds-choice__label" for="network-other">Another provider</label></div>
</div>
</fieldset>
</div>
<button class="ggds-button" type="submit">Continue</button>
</form><>
<p><a href="/complaints/start/">Back</a></p>
<form action="/complaints/details/" method="post" noValidate>
<div className="ggds-field">
<fieldset className="ggds-fieldset" aria-describedby="network-hint">
<legend className="ggds-fieldset__legend ggds-fieldset__legend--page"><h1>Which network are you complaining about?</h1></legend>
<p className="ggds-hint" id="network-hint">If it is about more than one, make a complaint for each.</p>
<div className="ggds-choices">
<div className="ggds-choice"><input className="ggds-choice__input" id="network-mtn" name="network" type="radio" value="mtn" /><label className="ggds-choice__label" htmlFor="network-mtn">MTN</label></div>
<div className="ggds-choice"><input className="ggds-choice__input" id="network-telecel" name="network" type="radio" value="telecel" /><label className="ggds-choice__label" htmlFor="network-telecel">Telecel</label></div>
<div className="ggds-choice"><input className="ggds-choice__input" id="network-at" name="network" type="radio" value="at" /><label className="ggds-choice__label" htmlFor="network-at">AT</label></div>
<div className="ggds-choice"><input className="ggds-choice__input" id="network-other" name="network" type="radio" value="other" /><label className="ggds-choice__label" htmlFor="network-other">Another provider</label></div>
</div>
</fieldset>
</div>
<button className="ggds-button" type="submit">Continue</button>
</form>
</>Example: A question page after a failed submit
<div class="ggds-error-summary" data-ggds-module="error-summary" role="alert" aria-labelledby="pattern-error-title" tabindex="-1">
<h2 class="ggds-error-summary__title" id="pattern-error-title">There is a problem</h2>
<ul class="ggds-error-summary__list">
<li><a href="#contact-phone">Enter a mobile number with 10 digits, like 024 000 0000</a></li>
</ul>
</div>
<h1>Your contact details</h1>
<form action="/complaints/check/" method="post" novalidate>
<div class="ggds-field">
<label class="ggds-label" for="contact-name">Full name</label>
<input class="ggds-input ggds-input--width-long" id="contact-name" name="name" type="text" autocomplete="name" spellcheck="false" value="Ama Owusu">
</div>
<div class="ggds-field ggds-field--error">
<label class="ggds-label" for="contact-phone">Mobile number</label>
<p class="ggds-hint" id="contact-phone-hint">We use it only to call you about this complaint.</p>
<p class="ggds-error-message" id="contact-phone-error"><span class="ggds-visually-hidden">Error:</span> Enter a mobile number with 10 digits, like 024 000 0000</p>
<input class="ggds-input ggds-input--width-medium" id="contact-phone" name="phone" type="tel" autocomplete="tel" inputmode="tel" aria-invalid="true" aria-describedby="contact-phone-hint contact-phone-error" value="024 12">
</div>
<button class="ggds-button" type="submit">Continue</button>
</form><>
<div className="ggds-error-summary" data-ggds-module="error-summary" role="alert" aria-labelledby="pattern-error-title" tabIndex={-1}>
<h2 className="ggds-error-summary__title" id="pattern-error-title">There is a problem</h2>
<ul className="ggds-error-summary__list">
<li><a href="#contact-phone">Enter a mobile number with 10 digits, like 024 000 0000</a></li>
</ul>
</div>
<h1>Your contact details</h1>
<form action="/complaints/check/" method="post" noValidate>
<div className="ggds-field">
<label className="ggds-label" htmlFor="contact-name">Full name</label>
<input className="ggds-input ggds-input--width-long" id="contact-name" name="name" type="text" autoComplete="name" spellCheck="false" defaultValue="Ama Owusu" />
</div>
<div className="ggds-field ggds-field--error">
<label className="ggds-label" htmlFor="contact-phone">Mobile number</label>
<p className="ggds-hint" id="contact-phone-hint">We use it only to call you about this complaint.</p>
<p className="ggds-error-message" id="contact-phone-error"><span className="ggds-visually-hidden">Error:</span> Enter a mobile number with 10 digits, like 024 000 0000</p>
<input className="ggds-input ggds-input--width-medium" id="contact-phone" name="phone" type="tel" autoComplete="tel" inputMode="tel" aria-invalid="true" aria-describedby="contact-phone-hint contact-phone-error" defaultValue="024 12" />
</div>
<button className="ggds-button" type="submit">Continue</button>
</form>
</>Example: Check your answers
<h1>Check your answers before sending</h1>
<h2>Your complaint</h2>
<dl class="ggds-summary-list">
<div class="ggds-summary-list__row">
<dt class="ggds-summary-list__key">Network</dt>
<dd class="ggds-summary-list__value">MTN</dd>
<dd class="ggds-summary-list__actions"><a href="/complaints/network/">Change<span class="ggds-visually-hidden"> network</span></a></dd>
</div>
<div class="ggds-summary-list__row">
<dt class="ggds-summary-list__key">What happened</dt>
<dd class="ggds-summary-list__value">Calls drop after a few seconds at home in Tema since 2 November.</dd>
<dd class="ggds-summary-list__actions"><a href="/complaints/problem/">Change<span class="ggds-visually-hidden"> what happened</span></a></dd>
</div>
<div class="ggds-summary-list__row">
<dt class="ggds-summary-list__key">Full name</dt>
<dd class="ggds-summary-list__value">Ama Owusu</dd>
<dd class="ggds-summary-list__actions"><a href="/complaints/details/">Change<span class="ggds-visually-hidden"> full name</span></a></dd>
</div>
<div class="ggds-summary-list__row">
<dt class="ggds-summary-list__key">Mobile number</dt>
<dd class="ggds-summary-list__value">024 000 0000</dd>
<dd class="ggds-summary-list__actions"><a href="/complaints/details/">Change<span class="ggds-visually-hidden"> mobile number</span></a></dd>
</div>
</dl>
<h2>Now send your complaint</h2>
<p>By sending it, you confirm the details are correct to the best of your knowledge.</p>
<form action="/complaints/sent/" method="post">
<button class="ggds-button" type="submit">Send complaint</button>
</form><>
<h1>Check your answers before sending</h1>
<h2>Your complaint</h2>
<dl className="ggds-summary-list">
<div className="ggds-summary-list__row">
<dt className="ggds-summary-list__key">Network</dt>
<dd className="ggds-summary-list__value">MTN</dd>
<dd className="ggds-summary-list__actions"><a href="/complaints/network/">Change<span className="ggds-visually-hidden"> network</span></a></dd>
</div>
<div className="ggds-summary-list__row">
<dt className="ggds-summary-list__key">What happened</dt>
<dd className="ggds-summary-list__value">Calls drop after a few seconds at home in Tema since 2 November.</dd>
<dd className="ggds-summary-list__actions"><a href="/complaints/problem/">Change<span className="ggds-visually-hidden"> what happened</span></a></dd>
</div>
<div className="ggds-summary-list__row">
<dt className="ggds-summary-list__key">Full name</dt>
<dd className="ggds-summary-list__value">Ama Owusu</dd>
<dd className="ggds-summary-list__actions"><a href="/complaints/details/">Change<span className="ggds-visually-hidden"> full name</span></a></dd>
</div>
<div className="ggds-summary-list__row">
<dt className="ggds-summary-list__key">Mobile number</dt>
<dd className="ggds-summary-list__value">024 000 0000</dd>
<dd className="ggds-summary-list__actions"><a href="/complaints/details/">Change<span className="ggds-visually-hidden"> mobile number</span></a></dd>
</div>
</dl>
<h2>Now send your complaint</h2>
<p>By sending it, you confirm the details are correct to the best of your knowledge.</p>
<form action="/complaints/sent/" method="post">
<button className="ggds-button" type="submit">Send complaint</button>
</form>
</>Example: Confirmation
<div class="ggds-panel">
<h1 class="ggds-panel__title">Complaint sent</h1>
<p class="ggds-panel__body">Your reference number <strong class="ggds-panel__reference">EX-2026-00456</strong></p>
</div>
<p>We have sent your reference number to 024 000 0000 by SMS. Write it down or take a screenshot.</p>
<h2>What happens next</h2>
<ol>
<li>We send your complaint to the network within 2 working days.</li>
<li>The network must reply to you within 10 working days.</li>
<li>If you are not happy with their reply, contact us with your reference number and we will look into it.</li>
</ol>
<p><a href="/contact/">Contact us about your complaint</a></p><>
<div className="ggds-panel">
<h1 className="ggds-panel__title">Complaint sent</h1>
<p className="ggds-panel__body">Your reference number <strong className="ggds-panel__reference">EX-2026-00456</strong></p>
</div>
<p>We have sent your reference number to 024 000 0000 by SMS. Write it down or take a screenshot.</p>
<h2>What happens next</h2>
<ol>
<li>We send your complaint to the network within 2 working days.</li>
<li>The network must reply to you within 10 working days.</li>
<li>If you are not happy with their reply, contact us with your reference number and we will look into it.</li>
</ol>
<p><a href="/contact/">Contact us about your complaint</a></p>
</>Components used
Something wrong, unclear or missing? or suggest a change to it on GitHub. You need a GitHub account.