Skip to content

Commit

Permalink
Merge revert-154-revert-147-rails7 into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
stage-branch-merger[bot] authored Jan 3, 2024
2 parents cde8876 + 20e8c19 commit f94cc0d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions public/campaign-form.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ if (typeof window.campaignForms === 'undefined') {
var campaignForms = window.campaignForms = window.campaignForms || {}
var campaignForm = window.campaignForm = window.campaignForm || {}
var idCounter = 0
console.log('line 11')

campaignForms.jQuery = $.noConflict(true)

function uniqueFormId () {
console.log('uniqueFormId')
var id = ++idCounter
return 'campaignForm' + id
}

function submitForm (form, recaptchaToken) {
console.log('submitForm')
var formId = form.attr('id')

if (!campaignForms[formId].formSubmitted) {
Expand Down Expand Up @@ -92,6 +95,7 @@ if (typeof window.campaignForms === 'undefined') {
}

function validate (form) {
console.log('validate')
return form.validate({
errorElement: 'span',
errorClass: 'help-block',
Expand Down Expand Up @@ -149,6 +153,7 @@ if (typeof window.campaignForms === 'undefined') {

// Register all existing forms (not previously registered)
window.campaignForms.registerForms = function () {
console.log('registerForms')
$('.campaign-form form:not([id])').each(function () {
var form = $(this)

Expand Down Expand Up @@ -187,10 +192,12 @@ if (typeof window.campaignForms === 'undefined') {

// Bootstrap campaign-forms
window.campaignForms.jQuery(function () {
console.log('bootstrap')
window.campaignForms.registerForms()
})

$(document).ready(function() {
console.log('ready')
$("[id^='cf_Country_']").change(function(){
if ($(this).val()!='US'){
$("[for^='cf_US_State_']").hide()
Expand Down

0 comments on commit f94cc0d

Please sign in to comment.