Embedded form functionSOLVE
Jul 10, 2019 1:39 PM
So far as I know, that's not possible. I believe the form redirect creates a new thread in the browser, which the callback functions don't have access to. There is some time before the redirect happens, so if you're running code that only takes a few milliseconds, the code should run I'd think. But if you're trying to do something that takes more time, like with timeouts or with promises, you could consider adding the redirect into your callback function. And then within the form editor, just select the inline thank you message option instead of the redirect.
You've probably seen our docs, but we have those callbacks and events documented here: https://developers.hubspot.com/docs/methods/forms/advanced_form_options and here: https://developers.hubspot.com/global-form-events.
If you're having trouble with a specific page, feel free to let me know and link it here.
Leland ScanlanHubSpot Developer Support