Created
June 19, 2016 12:58
-
-
Save denlunev/a34a1eb3308913c3ca28b6e3d7b7ba1d to your computer and use it in GitHub Desktop.
Execute code after HubSpot form submit
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
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