Skip to main content

This is a draft (version 0.5.0). The National Information Technology Agency (NITA) plans to make GGDS official guidance for government websites after independent accessibility testing. What this means

Ghana Government Design System Design system for Government of Ghana websites – home Search

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

  1. 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.
  2. Question pages. One question, or a few closely related ones, per page. The question is the page's heading.
  3. Check your answers. Every answer in a summary list, each with a "Change" link, and the declaration, then the button that sends it.
  4. 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 autocomplete to 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> (with ggds-fieldset__legend--page), or the <label> inside an <h1> (with ggds-label--page), so screen readers hear it once.

Example: A question page

Open this example on its own page

HTML code for “A question page”
HTML
<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>
JSX (React)
<>
  <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

Open this example on its own page

HTML code for “A question page after a failed submit”
HTML
<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>
JSX (React)
<>
  <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

Open this example on its own page

HTML code for “Check your answers”
HTML
<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>
JSX (React)
<>
  <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

Open this example on its own page

HTML code for “Confirmation”
HTML
<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>
JSX (React)
<>
  <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

  • Text input, textarea, select and file upload

    A single form question with a label, an optional hint and an error message.

  • Radios and checkboxes

    Let people choose one option (radios) or several (checkboxes) from a short list.

  • Date input

    Three boxes for day, month and year, for dates people already know, such as their date of birth.

  • Error summary

    A box at the top of the page that lists every problem after a form is submitted.

  • Summary list

    Questions and answers, or labels and values, as a list, with links to change them. For "Check your answers" pages and records.

  • Confirmation panel

    The top of the page people see when they have finished a task: that it worked, and their reference number.

  • Button

    Buttons do things: submit a form, save, continue.

Back to top

Something wrong, unclear or missing? Report a problem with this page or suggest a change to it on GitHub. You need a GitHub account.