SOLVED

Thank you message after for submit then redirect after a few seconds

Go to solution
Stefan_Gassner
Level 2

Thank you message after for submit then redirect after a few seconds

I am trying to get my form to redirect after I have showed the thank you message replacing the form on the same LP. 

I'm a novice when it comes to JS so would like some guidance. 

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Thank you message after for submit then redirect after a few seconds

MktoForms2.whenReady(function(form){
var redirectTimeMs = 4000; // 4 seconds
form.onSuccess(function(vals,thankYouURL){
// whatever you were going to do to show the Thank You message goes here
setTimeout(function(){
document.location.href = thankYouURL;
}, redirectTimeMs);
return false;
});
});

View solution in original post

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Thank you message after for submit then redirect after a few seconds

MktoForms2.whenReady(function(form){
var redirectTimeMs = 4000; // 4 seconds
form.onSuccess(function(vals,thankYouURL){
// whatever you were going to do to show the Thank You message goes here
setTimeout(function(){
document.location.href = thankYouURL;
}, redirectTimeMs);
return false;
});
});