Skip to content

Commit

Permalink
Reset form submission before showing errors
Browse files Browse the repository at this point in the history
showErrors appears to throw an exception unless DOM elements matching
the error are present, keeping formSubmitted from being reset to false
  • Loading branch information
canac committed Apr 16, 2024
1 parent 2f59847 commit bfc4c6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion public/campaign-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})
}
Expand Down

0 comments on commit bfc4c6b

Please sign in to comment.