Skip to content

Instantly share code, notes, and snippets.

@denlunev
Created June 19, 2016 12:58
Show Gist options
  • Save denlunev/a34a1eb3308913c3ca28b6e3d7b7ba1d to your computer and use it in GitHub Desktop.
Save denlunev/a34a1eb3308913c3ca28b6e3d7b7ba1d to your computer and use it in GitHub Desktop.
Execute code after HubSpot form submit
hbspt.forms.create({
...
onFormReady: function($form, ctx) {
$form.submit(function(){
//synchronous delay
HSPopup.pause(300);
//Your code goes here
});
}
});
function pause(milliseconds) {
var dt = new Date();
while ((new Date()) - dt <= milliseconds) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment