CMS Development

matttunney
Contributeur de premier rang

Ajax like swap landing page content on form submission

Résolue

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 Votes
1 Solution acceptée
matttunney
Solution
Contributeur de premier rang

Ajax like swap landing page content on form submission

Résolue

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
});

Voir la solution dans l'envoi d'origine

2 Réponses
Reg
Contributeur | Partenaire solutions Elite
Contributeur | Partenaire solutions Elite

Ajax like swap landing page content on form submission

Résolue

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
Solution
Contributeur de premier rang

Ajax like swap landing page content on form submission

Résolue

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
});