Skip to content

Commit

Permalink
Adds non-js validation for matrix cells
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniBitZesty committed Aug 8, 2023
1 parent 5f42c01 commit ee83e4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ def mobility_step3
classes "sub-question question-matrix"
ref "C 5.2"
required
required_rows :initiative_activities
context %(
<p>When answering this question, please refer to the guidance under C5.</p>
)
Expand Down
5 changes: 5 additions & 0 deletions app/views/qae_form/_matrix_question.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ table.matrix-question-table.govuk-table class="#{'auto-totals-column' if questio
= "#{y_heading.label} numbers for #{x_heading.label}"
input.js-trigger-autosave.matrix-question-input.govuk-input type="number" data-required-row-parent=question.required_row_parent min="0" step="1" name=question.input_name(suffix: "#{x_heading.key}_#{y_heading.key}") value=question.input_value(suffix: "#{x_heading.key}_#{y_heading.key}") id=question.input_name(suffix: "#{x_heading.key}_#{y_heading.key}") autocomplete="off" *possible_read_only_ops aria-describedby=(@form_answer.validator_errors && @form_answer.validator_errors[question.hash_key] ? "error_for_#{question.key}" : nil )
span.govuk-error-message aria-live="polite"
- if @form_answer.validator_errors && @form_answer.validator_errors["#{question.hash_key}_#{x_heading.key}_#{y_heading.key}"].present?
| Required
span.govuk-visually-hidden id="error_for_#{question.key}"
| Error:
=< @form_answer.validator_errors[question.hash_key]

0 comments on commit ee83e4c

Please sign in to comment.