We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, if you want to support pre-selecting the right option when going back to a radio field (eg from check your answers), you have to do this:
{{ radios({ "idPrefix": "example", "name": "example", "fieldset": { "legend": { "text": "Are you 18 or over?", "classes": "nhsuk-fieldset__legend--l", "isPageHeading": true } }, "items": [ { "value": "yes", "text": "Yes", checked: (data.example == "yes") }, { "value": "no", "text": "No", checked: (data.example == "no") } ] }) }}
This can be quite long-winded if there are a lot of options.
It’d be easier if we could support a top-level value option which sets the current value (if set), and then checks the right radio option:
value
{{ radios({ "idPrefix": "example", "name": "example", "value": data.example, "fieldset": { "legend": { "text": "Are you 18 or over?", "classes": "nhsuk-fieldset__legend--l", "isPageHeading": true } }, "items": [ { "value": "yes", "text": "Yes" }, { "value": "no", "text": "No" } ] }) }}
See code in GOVU.UK Design System for radios
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently, if you want to support pre-selecting the right option when going back to a radio field (eg from check your answers), you have to do this:
This can be quite long-winded if there are a lot of options.
It’d be easier if we could support a top-level
value
option which sets the current value (if set), and then checks the right radio option:See code in GOVU.UK Design System for radios
The text was updated successfully, but these errors were encountered: