Last active
April 18, 2017 09:51
-
-
Save MarioAraque/878a3e86362b74e80f12 to your computer and use it in GitHub Desktop.
Detect when hubspot form is submitted successfully
This file contains 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
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