APIs & Integrations

RThorp
Membro

Multi step form event listener

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 

4 Respostas 4
RYan86
Participante

Multi step form event listener

I also encountered the same problem, I would like to ask if you have found a solution

0 Avaliação positiva
RThorp
Membro

Multi step form event listener

Unfortunately not - hopefully something will be added as they move out of beta.

0 Avaliação positiva
GRajput
Especialista reconhecido(a) | Parceiro Ouro
Especialista reconhecido(a) | Parceiro Ouro

Multi step form event listener

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 Avaliação positiva
RThorp
Membro

Multi step form event listener

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