Expand my Community achievements bar.

SOLVED

Aem form submission to Marketo

Avatar

Level 3

Hi All,

 

We have  created form in sightly and we want to submit the data to Marketo.

Please anyone could tell me the approach on background submission to Marketo.

 

Thanks,

Mahesh

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

you can capture the form submission button click in javascript and do the submission by code and show the success/thank you message in place of form. Below is an example.

 

$('.marketo-form').on('click', '.mktoButton', function(event) {
event.preventDefault();
MktoForms2.whenReady(function(form){
//code to check values in form fields
form.submit();
form.onSuccess(function(vals,thanksURL){
form.getFormElem().hide();
$(".marketo-form").hide();
$(".thank-you").show();
return false;
});
});


});

 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

you can capture the form submission button click in javascript and do the submission by code and show the success/thank you message in place of form. Below is an example.

 

$('.marketo-form').on('click', '.mktoButton', function(event) {
event.preventDefault();
MktoForms2.whenReady(function(form){
//code to check values in form fields
form.submit();
form.onSuccess(function(vals,thanksURL){
form.getFormElem().hide();
$(".marketo-form").hide();
$(".thank-you").show();
return false;
});
});


});