APIs & Integrations

RThorp
Member

Multi step form event listener

SOLVE

Is it possible to register an event listener on the window for when a multi step form is submitted?

In normal forms, we can listen for the 'message' event as per the docs here, but this doesn't seem to be firing on the multi step forms.

 

Thanks!

Rich 

1 Accepted solution
GRajput
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Multi step form event listener

SOLVE

Hi @RThorp 

 

hbspt.forms.create({ portalId: "your_portal_id", formId: "your_form_id", onFormSubmit: function($form) {
 // call event here
 console.log("Form submitted!"); }
 });

 

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


View solution in original post

0 Upvotes
2 Replies 2
GRajput
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Multi step form event listener

SOLVE

Hi @RThorp 

 

hbspt.forms.create({ portalId: "your_portal_id", formId: "your_form_id", onFormSubmit: function($form) {
 // call event here
 console.log("Form submitted!"); }
 });

 

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


0 Upvotes
RThorp
Member

Multi step form event listener

SOLVE

Hi Gaurav,

 

Thanks for your reply.

 

Unfortunately, the code you sent is the method used to embed a normal (not a multi step form) on the page. 

 

So far as I can tell, you don't use the hs.forms.create method to embed a multi step form. See below snippet for multi step form embed code:

 

<script src="https://js.hsforms.net/forms/embed/1864311.js" defer></script>
<div class="hs-form-frame" data-region="na1" data-form-id="****form-id****" data-portal-id="****portal-id****"></div>

 

Thanks,

Rich

0 Upvotes