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 a Ghana Card number

One text box that accepts the number however people type it, says why you need it, and does not stop people when the check with NIA is not working.

When to use

  • When you must know exactly who someone is, such as for a licence, a registration, a tax matter or a payment.
  • When the law or your rules say you must record it.

When not to use

  • When a name, phone number or reference number would do, such as for a complaint, an enquiry or a newsletter. Only collect the personal data you need, and keep it safe. Ask your data protection lead if you are not sure.
  • Do not ask for it "just in case", or because another form did.

How it works

  1. The question is the page heading: "What is your Ghana Card number?"
  2. The hint says why you need it and what it looks like: "It starts with GHA, such as GHA-000000000-0".
  3. One text box, medium width, that accepts the number with or without hyphens and spaces, in capitals or small letters.
  4. A link for people without a card, such as "I do not have a Ghana Card yet", when your service can accept something else.

The format

A Ghana Card number (the personal ID number) is GHA, a hyphen, 9 digits, a hyphen and 1 check digit: GHA-XXXXXXXXX-X. To most people, that is "GHA and 10 numbers".

  • Always show an example that is clearly not real, such as GHA-000000000-0. Never use a real person's number in a hint, a test or a screenshot.
  • If your service is open to people who are not Ghanaian citizens, check with the National Identification Authority (NIA) what their cards look like before you add a rule that could reject them.

The text box

  • Use one type="text" box with the ggds-input--width-medium class. Do not split the number into several boxes: people paste it, and moving between boxes is hard with a keyboard or screen reader.
  • Do not use type="number". The number has letters and hyphens, and number boxes change what people type when they scroll.
  • Add autocomplete="off", spellcheck="false" and autocapitalize="characters", so the browser does not offer old answers or mark the number as a spelling mistake.
  • Do not set maxlength. People may type spaces, and a box that silently stops typing is confusing.

Checking the answer

  • Before you check it, tidy it: remove spaces and hyphens, and change small letters to capitals. "gha 000000000 0" and "GHA0000000000" are the same answer.
  • Then check the tidied number is GHA and 10 digits, and store it in one form, such as GHA-000000000-0.
  • Only check the check digit if NIA has given you the rule. Do not guess it.
  • Show the number back to people in the same form, with hyphens, on the check answers page.

Checking with NIA

  • Checking that a number is real, and that it belongs to the person, is a separate step on your server, using the access NIA has given your institution. It is not part of the form.
  • If the NIA check is slow or not working, do not stop people. Accept the answer, check it later, and say so: "We will check your Ghana Card number with NIA. We will contact you if there is a problem."
  • If a number does not match, do not tell people whose number it is or what name it belongs to. Ask them to check it, and give a way to get help.
  • Do not show NIA's error codes or messages to people. Log them instead.

People without a Ghana Card

  • Some people have applied but not yet got their card, and some cannot get one easily. Where the law allows, accept something else, such as their NIA application number, a passport or another ID, and say what you will accept.
  • Put the link next to the question, not on another page, so people do not give up.
  • If you really cannot help people without a card, say so on the start page, before they begin.

Error messages

Use these messages in the error summary and next to the field.

  • If it is empty: "Enter your Ghana Card number".
  • If it does not start with GHA: "Ghana Card number must start with GHA".
  • If it has too few or too many numbers: "Ghana Card number must have 10 numbers after GHA, such as GHA-000000000-0".
  • If it has other letters or symbols: "Ghana Card number must only include GHA, numbers and hyphens".
  • If NIA says it does not match: "Check your Ghana Card number. It must be the same as the number on your card".

Accessibility

  • Follow the accessibility advice in the ask for information pattern: a unique page title, the question as the heading, and a Back link.
  • Put the label inside the <h1>, so screen readers hear the question once.
  • Connect the hint and any error message to the box with aria-describedby, hint first, and add aria-invalid="true" on error.
  • Do not use placeholder text for the example. It disappears when people start typing.

Example: A question page

Open this example on its own page

HTML code for “A question page”
HTML
<p><a href="/apply/name/">Back</a></p>
<form action="/apply/date-of-birth/" method="post" novalidate>
  <div class="ggds-field">
    <h1><label class="ggds-label ggds-label--page" for="ghana-card">What is your Ghana Card number?</label></h1>
    <p class="ggds-hint" id="ghana-card-hint">We use it to confirm who you are with the National Identification Authority (NIA). It starts with GHA, such as GHA-000000000-0.</p>
    <input class="ggds-input ggds-input--width-medium" id="ghana-card" name="ghanaCardNumber" type="text" autocomplete="off" spellcheck="false" autocapitalize="characters" aria-describedby="ghana-card-hint">
  </div>
  <p><a href="/apply/other-id/">I do not have a Ghana Card yet</a></p>
  <button class="ggds-button" type="submit">Continue</button>
</form>
JSX (React)
<>
  <p><a href="/apply/name/">Back</a></p>
  <form action="/apply/date-of-birth/" method="post" noValidate>
    <div className="ggds-field">
      <h1><label className="ggds-label ggds-label--page" htmlFor="ghana-card">What is your Ghana Card number?</label></h1>
      <p className="ggds-hint" id="ghana-card-hint">We use it to confirm who you are with the National Identification Authority (NIA). It starts with GHA, such as GHA-000000000-0.</p>
      <input className="ggds-input ggds-input--width-medium" id="ghana-card" name="ghanaCardNumber" type="text" autoComplete="off" spellCheck="false" autocapitalize="characters" aria-describedby="ghana-card-hint" />
    </div>
    <p><a href="/apply/other-id/">I do not have a Ghana Card yet</a></p>
    <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
<p><a href="/apply/name/">Back</a></p>
<div class="ggds-error-summary" data-ggds-module="error-summary" role="alert" aria-labelledby="ghana-card-error-title" tabindex="-1">
  <h2 class="ggds-error-summary__title" id="ghana-card-error-title">There is a problem</h2>
  <ul class="ggds-error-summary__list">
    <li><a href="#ghana-card-number">Ghana Card number must have 10 numbers after GHA, such as GHA-000000000-0</a></li>
  </ul>
</div>
<form action="/apply/date-of-birth/" method="post" novalidate>
  <div class="ggds-field ggds-field--error">
    <h1><label class="ggds-label ggds-label--page" for="ghana-card-number">What is your Ghana Card number?</label></h1>
    <p class="ggds-hint" id="ghana-card-number-hint">We use it to confirm who you are with the National Identification Authority (NIA). It starts with GHA, such as GHA-000000000-0.</p>
    <p class="ggds-error-message" id="ghana-card-number-error"><span class="ggds-visually-hidden">Error:</span> Ghana Card number must have 10 numbers after GHA, such as GHA-000000000-0</p>
    <input class="ggds-input ggds-input--width-medium" id="ghana-card-number" name="ghanaCardNumber" type="text" autocomplete="off" spellcheck="false" autocapitalize="characters" aria-invalid="true" aria-describedby="ghana-card-number-hint ghana-card-number-error" value="GHA-0000000">
  </div>
  <p><a href="/apply/other-id/">I do not have a Ghana Card yet</a></p>
  <button class="ggds-button" type="submit">Continue</button>
</form>
JSX (React)
<>
  <p><a href="/apply/name/">Back</a></p>
  <div className="ggds-error-summary" data-ggds-module="error-summary" role="alert" aria-labelledby="ghana-card-error-title" tabIndex={-1}>
    <h2 className="ggds-error-summary__title" id="ghana-card-error-title">There is a problem</h2>
    <ul className="ggds-error-summary__list">
      <li><a href="#ghana-card-number">Ghana Card number must have 10 numbers after GHA, such as GHA-000000000-0</a></li>
    </ul>
  </div>
  <form action="/apply/date-of-birth/" method="post" noValidate>
    <div className="ggds-field ggds-field--error">
      <h1><label className="ggds-label ggds-label--page" htmlFor="ghana-card-number">What is your Ghana Card number?</label></h1>
      <p className="ggds-hint" id="ghana-card-number-hint">We use it to confirm who you are with the National Identification Authority (NIA). It starts with GHA, such as GHA-000000000-0.</p>
      <p className="ggds-error-message" id="ghana-card-number-error"><span className="ggds-visually-hidden">Error:</span> Ghana Card number must have 10 numbers after GHA, such as GHA-000000000-0</p>
      <input className="ggds-input ggds-input--width-medium" id="ghana-card-number" name="ghanaCardNumber" type="text" autoComplete="off" spellCheck="false" autocapitalize="characters" aria-invalid="true" aria-describedby="ghana-card-number-hint ghana-card-number-error" defaultValue="GHA-0000000" />
    </div>
    <p><a href="/apply/other-id/">I do not have a Ghana Card yet</a></p>
    <button className="ggds-button" type="submit">Continue</button>
  </form>
</>

Components used

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.