CMS Development

matttunney
Stratege/Strategin

Ajax like swap landing page content on form submission

lösung

How can I go about detecting when a form has been submitted on a landing page. This is so I can trigger change the content?

 

This might be replacing the submitted form or call to action with new content.

 

Is there a form javascript event I can listen for?

 

I'm currently using a the form module.

 

Thanks

0 Upvotes
1 Akzeptierte Lösung
matttunney
Lösung
Stratege/Strategin

Ajax like swap landing page content on form submission

lösung

I found a solution that looks for a particular event to take place here:

https://integrate.hubspot.com/t/how-to-track-form-submission-events-in-javascript/1741/2

 

$('.hs_cos_wrapper_type_form').on('hsvalidatedsubmit', '.hs-form', function (e) {
    //do something
});

Lösung in ursprünglichem Beitrag anzeigen

2 Antworten
Reg
Mitwirkender/Mitwirkende | Elite Partner
Mitwirkender/Mitwirkende | Elite Partner

Ajax like swap landing page content on form submission

lösung

Hi Matt,

 

It looks like you need to call the onFormSubmit callback. You can view the documentation here: https://developers.hubspot.com/docs/methods/forms/advanced_form_options

 

Cheers,

Reg

Reg Desgroseilliers
www.rdcoding.com
matttunney
Lösung
Stratege/Strategin

Ajax like swap landing page content on form submission

lösung

I found a solution that looks for a particular event to take place here:

https://integrate.hubspot.com/t/how-to-track-form-submission-events-in-javascript/1741/2

 

$('.hs_cos_wrapper_type_form').on('hsvalidatedsubmit', '.hs-form', function (e) {
    //do something
});