{{ aspExample({ code: "<div class=\"form__group\" id=\"select-example-1\">
<label class=\"form__label\" for=\"select-example-1-select\">Network</label>
<select class=\"form__input\" id=\"select-example-1-select\">
<option value=\"select\" id=\"select-example-1-placeholder\">Select network</option>
<option value=\"ba\" id=\"select-example-1-ba\">BA</option>
<option value=\"br\" id=\"select-example-1-br\">BR</option>
<option value=\"me\" id=\"select-example-1-me\">ME</option>
<option value=\"ns\" id=\"select-example-1-ns\">NS</option>
<option value=\"sg\" id=\"select-example-1-sg\">SG</option>
<option value=\"ss\" id=\"select-example-1-ss\">SS</option>
<option value=\"ws\" id=\"select-example-1-ws\">WS</option>
</select>
</div>", nunjucks: "", json: "", title: "", example: "", id: "663ce167c4caa" }) }}
WIP – When JavaScript is enabled, choosing a parent control option reveals related child fields. When JavaScript is disabled, those child fields are always shown instead, but indented so the relationship is still clear.
If a user fills in a child field without selecting its parent (something that can happen in a non‑JavaScript journey), the form should validate this on submission and explain that the parent choice is required. This keeps the behaviour consistent, prevents accidental or mismatched answers, and avoids confusion.
WIP – For no JS fallback (on conditional content):
– the conditional content will show (by default)
– add in noscript text to the label (required if “Question [parent Label]” is “Option to reveal conditional content”)
WIP – noscript text (required if “Question” is “Option to reveal conditional content”)
Use a select when there are 8 or more options and only one selection is allowed, based on Miller’s Law.
Exception: Use a select even in lists when the number of options are variable or unknown, may grow beyond 7, and supporting both patterns would add unnecessary code logic. This avoids inconsistent UI on the same question, keeping the experience consistent (Krug’s Law), and prevents accidental taps on mobile where long radio lists expose touch targets while scrolling.
WIP – Use radios if there is 7 or less options and only one available selection.
If a user has the option to select more than one option, use a check box group.
This component can be added within a conditional question.
WIP — The first option (used as a placeholder) should use “Select” and never be disabled
WIP – Do not use “disabled” attributes (usually for the first option, utilised as a placeholder). This causes the contrast on desktops on some browsers to have a weak contrast between background (light grey) and text (white) colours. Instead; remove disabled options and allow for user to input that option with error messaging as a fall back.
See Radios for conditional text input / select / textarea options. Also hint and errors within conditional content
The below criteria all need to be met for a component to be considered as fully developed for use within the ASP Digital Design System.