Skip to content

Commit

Permalink
Merge pull request #2470 from bitzesty/fix-non-js-save
Browse files Browse the repository at this point in the history
[staging] fix form not being saved properly without js
  • Loading branch information
dreamfall authored Aug 7, 2023
2 parents ff68d43 + 71dd603 commit 5f42c01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/qae_form/_step.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
= step.title
- if step.context
== step.context
input type="hidden" name="form[current_non_js_step]" value="#{step.title.parameterize}" id="non_js_step_title"

= render partial: "qae_form/question", collection: step.questions, locals: { answers: answers, attachments: attachments }
- if step.submit
= render partial: "qae_form/step_submit", object: step.submit, as: 'submit'
Expand Down
1 change: 1 addition & 0 deletions app/views/qae_form/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ form.qae-form.award-form data-autosave-url=save_form_url(@form_answer) action=sa
input name="authenticity_token" type="hidden" value=form_authenticity_token

= hidden_field_tag :current_step_id, (params[:step].present? ? params[:step] : @form.steps.first.title.parameterize)
input type="hidden" name="form[current_non_js_step]" value="#{params[:step].presence || @form.steps.first.title.parameterize}" id="non_js_step_title"

h1.govuk-heading-xl
= @form.title
Expand Down

0 comments on commit 5f42c01

Please sign in to comment.