You need to sign in to do that
Don't have an account?

Display a Thank you page before redirect.
I have a visualforce sites form. When the visitor clicks the submit button, I save the information in the database and then redirect the user to a landing page (e.g www.example.com). I would like to ideally display a "Thank you" page for 5 seconds that confirms that the form was submitted before doing the redirect.
VF Page: <apex:pageBlockButtons > <apex:commandButton action="{!Submit}" value = "Submit" /> </apex:pageBlockButtons> Apex Code; public pagereference Submit() { //save to db code first //redirect now landingPage = new PageReference('http://www.example.com'); landingPage.setRedirect(true); return landingPage; }
<script type="text/javascript">
window.setTimeout("redirectpage();", 5000);
function redirectpage(){
window.top.location.href = 'http://www.redirectpageurl.com';
}
</script>
All Answers
<script type="text/javascript">
window.setTimeout("redirectpage();", 5000);
function redirectpage(){
window.top.location.href = 'http://www.redirectpageurl.com';
}
</script>