<divclass="nhsuk-width-container"><aclass="nhsuk-back-link"href="#">
Back
</a><mainclass="nhsuk-main-wrapper nhsuk-main-wrapper--s"id="maincontent"><divclass="nhsuk-grid-row"><divclass="nhsuk-grid-column-two-thirds"><formaction="/form-handler"method="post"novalidate><divclass="nhsuk-form-group"><fieldsetclass="nhsuk-fieldset"><legendclass="nhsuk-fieldset__legend nhsuk-fieldset__legend--l"><h1class="nhsuk-fieldset__heading">
Where do you live?
</h1></legend><divclass="nhsuk-radios"data-module="nhsuk-radios"><divclass="nhsuk-radios__item"><inputclass="nhsuk-radios__input"id="whereDoYouLive"name="whereDoYouLive"type="radio"value="england"><labelclass="nhsuk-label nhsuk-radios__label"for="whereDoYouLive">
England
</label></div><divclass="nhsuk-radios__item"><inputclass="nhsuk-radios__input"id="whereDoYouLive-2"name="whereDoYouLive"type="radio"value="scotland"><labelclass="nhsuk-label nhsuk-radios__label"for="whereDoYouLive-2">
Scotland
</label></div><divclass="nhsuk-radios__item"><inputclass="nhsuk-radios__input"id="whereDoYouLive-3"name="whereDoYouLive"type="radio"value="wales"><labelclass="nhsuk-label nhsuk-radios__label"for="whereDoYouLive-3">
Wales
</label></div><divclass="nhsuk-radios__item"><inputclass="nhsuk-radios__input"id="whereDoYouLive-4"name="whereDoYouLive"type="radio"value="northern-ireland"><labelclass="nhsuk-label nhsuk-radios__label"for="whereDoYouLive-4">
Northern Ireland
</label></div></div></fieldset></div><buttonclass="nhsuk-button"data-module="nhsuk-button"type="submit">
Continue
</button></form></div></div></main></div>
Sometimes it makes sense to group related questions on the same page. User research will tell you when to do this. See the section on asking multiple questions on a page.
Elements you must include
Question pages must include a:
back link
page heading
way for users to input information
continue button
Back link
Some users do not trust browser back buttons when they're entering data.
Always include a back link component at the top of question pages to reassure users it's possible to go back and change previous answers.
However, do not break the browser back button. Make sure it takes users to the previous page they were on, in the state they last saw it.
An exception to this is when the user has performed an action they should only do once, like make a payment or complete an application. The browser back button should still work, but show the user a sensible message rather than letting them perform the action again.
Page heading
Usually the page heading should be the question. Do this by placing the heading (<h1>) into the label or legend. Find out about using legends, labels and captions.
Sometimes the page heading will be a statement. Find out more about when to use statements in the sections on:
Make sure to only ask for a piece of information once within a single journey.
If the same type of information is needed more than once, make it easier to reuse previously entered answers by:
pre-populating the relevant fields
showing carried-forward responses as an option for the user to select
Continue button
Make sure your Continue button is:
labelled "Continue", not "Next"
aligned to the left so users do not miss it
Using legends, labels and captions
For single question pages, using a <legend> or <label> as the page heading is good practice as it means that screen reader users will only hear the contents once. (Use a legend for a group or set of elements as a whole and a label for a specific element, like a text input.)
<divclass="nhsuk-width-container"><aclass="nhsuk-back-link"href="#">
Back
</a><mainclass="nhsuk-main-wrapper nhsuk-main-wrapper--s"id="maincontent"><divclass="nhsuk-grid-row"><divclass="nhsuk-grid-column-two-thirds"><formaction="/form-handler"method="post"novalidate><divclass="nhsuk-form-group"><fieldsetclass="nhsuk-fieldset"role="group"aria-describedby="example-hint"><legendclass="nhsuk-fieldset__legend nhsuk-fieldset__legend--l"><h1class="nhsuk-fieldset__heading">
What is your date of birth?
</h1></legend><divclass="nhsuk-hint"id="example-hint">
For example, 15 3 1984
</div><divclass="nhsuk-date-input"id="example"><divclass="nhsuk-date-input__item"><divclass="nhsuk-form-group"><labelclass="nhsuk-label nhsuk-date-input__label"for="example-day">
Day
</label><inputclass="nhsuk-input nhsuk-input--width-2 nhsuk-date-input__input"id="example-day"name="example[day]"type="text"inputmode="numeric"></div></div><divclass="nhsuk-date-input__item"><divclass="nhsuk-form-group"><labelclass="nhsuk-label nhsuk-date-input__label"for="example-month">
Month
</label><inputclass="nhsuk-input nhsuk-input--width-2 nhsuk-date-input__input"id="example-month"name="example[month]"type="text"inputmode="numeric"></div></div><divclass="nhsuk-date-input__item"><divclass="nhsuk-form-group"><labelclass="nhsuk-label nhsuk-date-input__label"for="example-year">
Year
</label><inputclass="nhsuk-input nhsuk-input--width-4 nhsuk-date-input__input"id="example-year"name="example[year]"type="text"inputmode="numeric"></div></div></div></fieldset></div><buttonclass="nhsuk-button"data-module="nhsuk-button"type="submit">
Continue
</button></form></div></div></main></div>
<divclass="nhsuk-width-container"><aclass="nhsuk-back-link"href="#">
Back
</a><mainclass="nhsuk-main-wrapper nhsuk-main-wrapper--s"id="maincontent"><divclass="nhsuk-grid-row"><divclass="nhsuk-grid-column-two-thirds"><formaction="/form-handler"method="post"novalidate><divclass="nhsuk-form-group"><h1class="nhsuk-label-wrapper"><labelclass="nhsuk-label nhsuk-label--l"for="postcode">
What is your home postcode?
</label></h1><inputclass="nhsuk-input nhsuk-input--width-10"id="postcode"name="postcode"type="text"autocomplete="postal-code"></div><buttonclass="nhsuk-button"data-module="nhsuk-button"type="submit">
Continue
</button></form></div></div></main></div>
Do not use the same page heading across multiple pages. The page heading should relate specifically to the information being asked for on the current page, not any higher-level section the page is part of.
<divclass="nhsuk-width-container"><aclass="nhsuk-back-link"href="#">
Back
</a><mainclass="nhsuk-main-wrapper nhsuk-main-wrapper--s"id="maincontent"><divclass="nhsuk-grid-row"><divclass="nhsuk-grid-column-two-thirds"><h1class="nhsuk-heading-l">
If we need to contact you
</h1><p>Let us know if you have any communication needs you'd like us to be aware of. For example, a hearing or visual impairment.</p><formaction="/form-handler"method="post"novalidate><divclass="nhsuk-form-group"><fieldsetclass="nhsuk-fieldset"><legendclass="nhsuk-fieldset__legend nhsuk-fieldset__legend--m">
Do you have any communication needs?
</legend><divclass="nhsuk-radios"data-module="nhsuk-radios"><divclass="nhsuk-radios__item"><inputclass="nhsuk-radios__input"id="contactNeeds"name="contactNeeds"type="radio"value="yes"><labelclass="nhsuk-label nhsuk-radios__label"for="contactNeeds">
Yes
</label></div><divclass="nhsuk-radios__item"><inputclass="nhsuk-radios__input"id="contactNeeds-2"name="contactNeeds"type="radio"value="no"><labelclass="nhsuk-label nhsuk-radios__label"for="contactNeeds-2">
No
</label></div></div></fieldset></div><buttonclass="nhsuk-button"data-module="nhsuk-button"type="submit">
Continue
</button></form></div></div></main></div>
{% from"back-link/macro.njk"importbackLink %}{% from"button/macro.njk"importbutton %}{% from"radios/macro.njk"importradios %}{% setmainClasses = "nhsuk-main-wrapper--s" %}{% blockbeforeContent %}{{ backLink({
href: "#",
text: "Back"
}) }}{% endblock %}{% blockcontent %}<divclass="nhsuk-grid-row"><divclass="nhsuk-grid-column-two-thirds"><h1class="nhsuk-heading-l">
If we need to contact you
</h1><p>Let us know if you have any communication needs you'd like us to be aware of. For example, a hearing or visual impairment.</p><formaction="/form-handler"method="post"novalidate>{{ radios({
fieldset: {
legend: {
text: "Do you have any communication needs?",
size: "m"
}
},
name: "contactNeeds",
items: [
{
value: "yes",
text: "Yes"
},
{
value: "no",
text: "No"
}
]
}) }}{{ button({
text: "Continue"
}) }}</form></div></div>{% endblock %}
Asking multiple questions on a page
Sometimes it makes sense to group related questions on the same page. For example, if you're designing an internal service for staff who need to repeat and switch between tasks quickly.
If you need to ask for multiple related things on a page, use a statement as the heading.
<divclass="nhsuk-width-container"><aclass="nhsuk-back-link"href="#">
Back
</a><mainclass="nhsuk-main-wrapper nhsuk-main-wrapper--s"id="maincontent"><divclass="nhsuk-grid-row"><divclass="nhsuk-grid-column-two-thirds"><h1class="nhsuk-heading-l">
Your details
</h1><p>You've told us you are the carer. We need your details.</p><formaction="/form-handler"method="post"novalidate><divclass="nhsuk-form-group"><labelclass="nhsuk-label nhsuk-label--s"for="example">
First name
</label><inputclass="nhsuk-input"id="example"name="example"type="text"></div><divclass="nhsuk-form-group"><labelclass="nhsuk-label nhsuk-label--s"for="example1">
Last name
</label><inputclass="nhsuk-input"id="example1"name="example1"type="text"></div><divclass="nhsuk-form-group"><labelclass="nhsuk-label nhsuk-label--s"for="example2">
Relationship to the person being registered
</label><divclass="nhsuk-hint"id="example2-hint">
For example, a family member or friend
</div><inputclass="nhsuk-input"id="example2"name="example2"type="text"aria-describedby="example2-hint"></div><divclass="nhsuk-form-group"><labelclass="nhsuk-label nhsuk-label--s"for="example3">
Contact phone number
</label><inputclass="nhsuk-input nhsuk-input--width-20"id="example3"name="example3"type="tel"autocomplete="tel"></div><buttonclass="nhsuk-button"data-module="nhsuk-button"type="submit">
Continue
</button></form></div></div></main></div>
{% from"back-link/macro.njk"importbackLink %}{% from"button/macro.njk"importbutton %}{% from"input/macro.njk"importinput %}{% setmainClasses = "nhsuk-main-wrapper--s" %}{% blockbeforeContent %}{{ backLink({
href: "#",
text: "Back"
}) }}{% endblock %}{% blockcontent %}<divclass="nhsuk-grid-row"><divclass="nhsuk-grid-column-two-thirds"><h1class="nhsuk-heading-l">
Your details
</h1><p>You've told us you are the carer. We need your details.</p><formaction="/form-handler"method="post"novalidate>{{ input({
label: {
text: "First name",
size: "s"
},
id: "example",
name: "example"
}) }}{{ input({
label: {
text: "Last name",
size: "s"
},
id: "example1",
name: "example1"
}) }}{{ input({
label: {
text: "Relationship to the person being registered",
size: "s"
},
hint: {
text: "For example, a family member or friend"
},
id: "example2",
name: "example2"
}) }}{{ input({
label: {
text: "Contact phone number",
size: "s"
},
id: "example3",
name: "example3",
width: 20,
type: "tel",
autocomplete: "tel"
}) }}{{ button({
text: "Continue"
}) }}</form></div></div>{% endblock %}
Using progress indicators
Start by testing your form without a progress indicator to see if it's simple enough that users do not need one.
Try improving the order, type or number of questions before adding a progress indicator. If people still have difficulty, try adding a simple step or question indicator like this one.
<spanclass="nhsuk-caption-l">Question 3 of 9</span><h1class="nhsuk-heading-l">
Your details
</h1>
Only include the total number of questions if you can do so reliably. As the user moves through the form, make sure the indicator updates to tell them which question they are on and the total number remaining.
Do not use progress indicators, like this one, that show all the questions at once.
These can be problematic because they:
are often not noticed
take up lots of space
do not scale well on small screens
can distract and confuse some users
make it hard to write good labels for the steps
make it hard to handle conditional sections
Using range sliders
Avoid using range slider questions, where the user needs to click and drag a selector across a range of answers or values. These types of controls are difficult for some users to interact with.