“Stay On Page” is indeed somewhat of a misnomer. It would be better called “Reload Same Page” — but it unlikely to be changed after all this time!
To remain on the same page and not reload it, return false from a custom onSuccess function.
Then do whatever else you want instead of reloading.
MktoForms2.whenReady(function(readyForm){
readyForm.onSuccess(function(submittedValues,originalThankYouURL){
/* do whatever else you want to do here, just make sure to return false */
return false;
});
});
As a very basic example, you can replace the entire form element with static HTML:
MktoForms2.whenReady(function(readyForm){
const formEl = readyForm.getFormElem()[0];
readyForm.onSuccess(function(submittedValues,originalThankYouURL){
/* do whatever else you want to do here, just make sure to return false */
formEl.innerHTML = "Thank you.";
return false;
});
});
The Forms 2.0 API is designed to let you add any custom behavior you want instead of reloading/redirecting.