Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions app/assets/javascripts/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ document.addEventListener('turbolinks:load', function() {
$(this)
.parent()
.text()
.includes('I accept')
.includes('I read and accept')
) {
notify(this, 'Please read & accept');
notify(".agreement_input", 'Please read & accept');
} else {
notify(this, 'Missing Information');
}
Expand Down Expand Up @@ -79,6 +79,13 @@ document.addEventListener('turbolinks:load', function() {
.fadeOut(200, function() {
$(this).remove();
});
$(".agreement_input")
.parent()
.removeClass('field_with_errors')
.find('.error')
.fadeOut(200, function() {
$(this).remove();
});
}
return success;
};
Expand Down
3 changes: 2 additions & 1 deletion app/views/questionnaires/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
%strong Agreements
%p Please review the agreements and click the corresponding checkbox next to each agreement to agree.
.form-inputs
= f.association :agreements, as: :check_boxes, label_method: :formatted_agreement, value_method: :id, label: "", wrapper_html: { style: 'display: block' }, input_html: { "data-validate" => "presence" }
.agreement_input
= f.association :agreements, as: :check_boxes, label_method: :formatted_agreement, value_method: :id, label: "", wrapper_html: { style: 'display: block' }, input_html: { "data-validate" => "presence" }

.right
%button.button{ type: "button", "data-wizard" => "previous" } Previous
Expand Down