APIs & Integrations

zwolfson
HubSpot Employee
HubSpot Employee

New Feature - onFormSubmitted callback function for embedded forms

What’s happening?

We are adding a new onFormSubmitted callback function to the advanced form options. This callback will fire after form submission data has been accepted by HubSpot, allowing you to perform an action when the submission is fully complete, such as displaying a confirmation or thank you message.

This differs from the onFormSubmit callback, which is triggered during the submission process, but fires before the data has been sent to HubSpot.

When is this happening?

This feature is live today.

If you have any questions, please join the discussion here. 

2 Replies 2
chrispower
Contributor

New Feature - onFormSubmitted callback function for embedded forms

Is there any reason why this callback doesn't accept the $form object in the same way onFormSubmit does?

 

We've implemented custom embed code which uses onFormSubmit to grab the email from a submitted form, and passes it to the next form using a custom redirect url.  It also has a brief setTimeout before redirecting.

 

This has worked fine until we started submitted these forms from mobile devices in the field with sometimes poor connectivity, and with multiple images on the form.  It appears the redirect happens prior to the form being completely submitted. 

 

onFormSubmitted didn't exist when we implemented this functionality, and it seems like an obvious fix, but I can't access the email in the onFormSubmitted callback so it doesn't work.

 

 

BCousin13
Participant

New Feature - onFormSubmitted callback function for embedded forms

@chrispower did you ever get this figured out. I'm running into the same issue.