Hello,
We are using Marketo forms embedded on our external website. We have followed the instructions from the developer tools on how to use JavaScript to have a confirmation message appear after the form is completed, rather than lead to an separate landing page. (Instructions: http://developers.marketo.com/blog/show-thank-you-message-without-a-follow-up-landing-page/ ) These confirmations are working correctly for individual form fill-outs with no issue.
However, we have a newsletter subscription form that is permanently in the footer of our website. We have noticed that on pages where our resource download forms exist, the confirmation appears on the resource form after completion, as well as subscription form at the bottom.
Does anyone know what we have to edit in our JavaScript to make sure that the confirmation only appears for that specifically identified form?
Thank you!!
Solved! Go to Solution.
Yes, that code adds the listener to all Marketo forms, so any form that was successfully submitted gets the Thank You message.
To address only specific forms, you can adapt the code like this:
MktoForms2.whenReady(function (form){
var samePageTYForms = [122,222,656];
if ( samePageTYForms.indexOf(form.getId()) != -1 ) {
form.onSuccess(function(values, followUpUrl){
// rest of listener code omitted for brevity
});
}
});
Where samePageTYForms is an array of the form IDs for which you want to use same-page Thank You. Any other forms will be ignored.
You might also check the method on my post http://blog.teknkl.com/same-page-thank-you-text-with-marketo-forms-about-the-aliid/ which I (naturally!) find more flexible.
Yes, that code adds the listener to all Marketo forms, so any form that was successfully submitted gets the Thank You message.
To address only specific forms, you can adapt the code like this:
MktoForms2.whenReady(function (form){
var samePageTYForms = [122,222,656];
if ( samePageTYForms.indexOf(form.getId()) != -1 ) {
form.onSuccess(function(values, followUpUrl){
// rest of listener code omitted for brevity
});
}
});
Where samePageTYForms is an array of the form IDs for which you want to use same-page Thank You. Any other forms will be ignored.
You might also check the method on my post http://blog.teknkl.com/same-page-thank-you-text-with-marketo-forms-about-the-aliid/ which I (naturally!) find more flexible.
This worked perfectly - thanks so much Sanford!
Thanks Sanford, this is cool!
Is there a way to do this using the guided landing pages?
Yes, you just need to add the script at the end of the landing page or it's template.
<script>
MktoForms2.whenReady(function (form) {
var samePageTYForms = [122,222,656];
if ( samePageTYForms.indexOf(form.getId()) != -1 ) {
form.onSuccess(function(values, followUpUrl){
// rest of listener code omitted for brevity
});
}
});
</script>
-Greg