From bfc4c6bf228329c14146743f90d9c5ba9a4176df Mon Sep 17 00:00:00 2001 From: Caleb Cox Date: Tue, 16 Apr 2024 14:08:32 -0500 Subject: [PATCH] Reset form submission before showing errors showErrors appears to throw an exception unless DOM elements matching the error are present, keeping formSubmitted from being reset to false --- public/campaign-form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/campaign-form.js b/public/campaign-form.js index 70c08ca..1bf8783 100644 --- a/public/campaign-form.js +++ b/public/campaign-form.js @@ -73,8 +73,8 @@ const postScriptLoad = function () { if (typeof errors.error !== 'undefined') form.parents('.campaign-form').find('.alert-danger').removeClass('hidden') // show errors from rails - campaignForms[formId].validator.showErrors(errors) campaignForms[formId].formSubmitted = false + campaignForms[formId].validator.showErrors(errors) } }) }