Skip to content

Instantly share code, notes, and snippets.

@MarioAraque
Last active April 18, 2017 09:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarioAraque/878a3e86362b74e80f12 to your computer and use it in GitHub Desktop.
Save MarioAraque/878a3e86362b74e80f12 to your computer and use it in GitHub Desktop.
Detect when hubspot form is submitted successfully
hbspt.forms.create({
portalId: '', //Your portal ID
formId: '', // Your form ID
css: '',
onFormReady: function(form, ctx) {
form.parents('.hbspt-form:first').on('DOMSubtreeModified', function() {
var hsForm = $(this);
if(hsForm.find('.submitted-message').length) {
//Your code.
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment