diff --git a/app/views/form/_radio_question.html.erb b/app/views/form/_radio_question.html.erb index 3681bb21d..8a342b971 100644 --- a/app/views/form/_radio_question.html.erb +++ b/app/views/form/_radio_question.html.erb @@ -7,7 +7,29 @@ <% if key.starts_with?("divider") %> <%= f.govuk_radio_divider %> <% else %> - <%= f.govuk_radio_button question_key, key, label: { text: val } %> + <%= f.govuk_radio_button question_key, key, label: { text: val }, onchange: "displayConditional()" %> <% end %> <% end %> <% end %> + + diff --git a/app/views/form/page.html.erb b/app/views/form/page.html.erb index 997587d37..d8df7605d 100644 --- a/app/views/form/page.html.erb +++ b/app/views/form/page.html.erb @@ -14,7 +14,9 @@ <%= form_with action: '/case_logs', method: "next_page", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> <% page_info["questions"].map do |question_key, question| %> - <%= render partial: "form/#{question["type"]}_question", locals: { question_key: question_key, question: question, f: f } %> +
> + <%= render partial: "form/#{question["type"]}_question", locals: { question_key: question_key, question: question, f: f } %> +
<% end %> <%= f.hidden_field :previous_page, value: page_key %> diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index 83d80674a..d2b097ef5 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -296,6 +296,9 @@ "1": "No - they left up to 5 years ago", "2": "No - they left more than 5 years ago", "3": "Prefer not to say" + }, + "show_if": { + "armed_forces": ["0", "1"] } }, "armed_forces_injured": { @@ -306,6 +309,9 @@ "0": "Yes", "1": "No", "2": "Prefer not to say" + }, + "show_if": { + "armed_forces": ["0", "1"] } }, "armed_forces_partner": {