Skip to content

Commit

Permalink
Merge cruorg-263-campaign-forms-script into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
stage-branch-merger[bot] authored Apr 16, 2024
2 parents c7d22bf + e2510cb commit 3d4ef91
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions public/campaign-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ const postScriptLoad = function () {
'event': 'ga-email-signup'
})

// Call optional success callback if defined
// Call optional success callbacks if defined
if (typeof campaignForm.successCallback === 'function') {
window.campaignForm.successCallback(data.master_person_id)
}
window.campaignForms.formSubmittedCallback?.(form)

// redirect if setup
if (typeof data.redirect_url !== 'undefined') {
Expand All @@ -72,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 3d4ef91

Please sign in to comment.