Created
September 28, 2023 08:43
-
-
Save apsolut/90e7519bf353bfadb4a206f7ee361899 to your computer and use it in GitHub Desktop.
HS onform submitt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.hs_cos_wrapper_type_form').on('hsvalidatedsubmit', '.hs-form', function (e) { | |
console.log( 'check check' ); | |
}); | |
window.addEventListener('message', function (event) { | |
if (event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmit') { | |
/* print to the console on submit, or add in custom redirect in here */ | |
console.log('onFormSubmit'); | |
} | |
}); | |
window.addEventListener('message', event => { | |
if(event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmitted') { | |
console.log("Form Submitted! Event data: ${event.data}"); | |
} | |
}); | |
window.addEventListener('message', event => { | |
if(event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormReady') { | |
console.log("HubSpot form added to page"); | |
} | |
}); | |
$('body').on('hsvalidatedsubmit', '.hs-form', function (e) { | |
console.log("HubSpot X"); | |
}); | |
console.log( ';start' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment