Thank you message after for submit then redirect after a few seconds | Community
Skip to main content
Stefan_Gassner
New Participant
May 16, 2019
Solved

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

  • May 16, 2019
  • 1 reply
  • 2387 views

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. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman
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;
});
});

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
May 16, 2019
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;
});
});