diff --git a/app/assets/javascripts/frontend/form-validation.js.coffee b/app/assets/javascripts/frontend/form-validation.js.coffee index f59f3bc59..8777d7591 100644 --- a/app/assets/javascripts/frontend/form-validation.js.coffee +++ b/app/assets/javascripts/frontend/form-validation.js.coffee @@ -56,6 +56,9 @@ window.FormValidation = isCheckboxQuestion: (question) -> question.find("input[type='checkbox']").length + isSupportLetterAttachment: (question) -> + question.find(".js-support-letter-attachment").length + toDate: (str) -> moment(str, "DD/MM/YYYY") @@ -81,6 +84,9 @@ window.FormValidation = if @isCheckboxQuestion(question) return question.find("input[type='checkbox']").filter(":checked").length + if @isSupportLetterAttachment(question) + return question.find(".js-support-letter-attachment-id").val().toString().trim().length + validateRequiredQuestion: (question) -> # if it's a conditional question, but condition was not satisfied conditional = true