-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
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
Form with error not showing selected conditional content #608
Comments
Hi Nuno, Are you using the Nunjucks template or the HTML component? I am unable to replicate the issue using Nunjucks. If using HTML you will need to ensure you have handled the setting of classes and IDs manually for the functionality to work. Also the general layout looks like it will may have accessibility issues caused by nesting fieldsets. Thanks, Tom |
We're using https://github.com/DFE-Digital/govuk_design_system_formbuilder to generate the HTML for this form. This gem takes care of the classes and IDs and all is working fine in regards to using the conditional. The only issue is when the page is rendered in a state when the content should be expanded but it's not. |
Hey @nunommc, The conditional content guidance says:
I would suggest making the Yes/No question a 'filter question' and using the 'one thing per page principle'. The questions within the conditional content ("When did your symptoms start?" and "Which symptoms have you experienced?") would become separate pages (one thing per page), fixing your issue. This will also simplify the user interaction by giving users only:
Also, (like Tom mentioned) having a fieldset within a fieldset is an accessibility issue. See the 'Using the fieldset and legend elements' blog post.
I hope this helps. |
Hi Nuno, As far as I can see in the documentation the form builder is not made to work with NHS.UK Frontend. Any work needed to make it work would need to be in the form builder codebase. NHS.UK Frontend cannot be switched like for like with GOV.UK Design System. Since NHS.UK was created as a fork of GOV.UK both libraries have grown in their own ways to address their own user needs. |
Hi @tomdoughty - there is a beta version of the Beta form builder for CTAS project which was adapted by Peter Yates. |
@davidhunter08 I have addressed your suggestion around accessibility with a colleague who is focused on this area. Thank you. |
Hi @WorkSutton |
This looks like it could be a potential issue with the way the form is being put together, it's expected that users write their own logic for error messages and error summaries, this would also be the case to display the conditional reveals on error. It seems this is being picked up as part of the form builder repo - are we happy to close this issue? |
Bug Report
What is the issue?
Please watch this video for details.
When a form is submitted
And the validations are not fulfilled
The form is re-rendered with errors
However, the conditional content previously displayed is now hidden and the user will not easily find the error in the form.
Expected to show the conditional content on page load.
The text was updated successfully, but these errors were encountered: