JotForm User Guide / Advanced Features /

Create a Custom Thank you page with Auto-redirect

Create a Custom Thank you page with Auto-redirect

If you want your form to redirect to another website or back to the form after submission with a countdown timer, here's how:

1. Open your favorite text editor such as Notepad.

2. Paste the following code and modify the values to your preferences (text in blue). You can also get the code here: https://pastebin.com/raw/UWBPhz3m

<div style="text-align:center;">
<h1>Thank you!</h1>
<p>Your submission has been received.</p>
<span id="timer"></span></div>

<script type="text/javascript">
var count = 5;
var redirect = "https://www.jotform.com";
function countDown(){
    var timer = document.getElementById("timer");
    if(count > 0){
        count--;
        timer.innerHTML = "This page will redirect in "+count+" seconds.";
        setTimeout("countDown()", 1000);
}else{
        window.location.href = redirect;
    }
}
countDown();
</script>

3. Save it as HTML file e.g. thankyou.html and upload it to your server.

4. Get the link of the HTML file and set it as your form's Thank you page.

Send Comment

25 Comments...

  • ravi

    welcome

  • Chuxin Liang

    Thank you page!

  • Mellow

    I had tried a bunch but not luck until I got to this site. I just wish that it will have some kind of validation code to it, because for emails are required to do this. Thanks for the script!

  • Thosbryan

    I cut and pasted your sample code into the thank you HTML box. When I executed the form all I got was the thank you text,. No redirect, just the balance of the HTML code,

  • giacosmom

    Sorry -- this makes very little sense to me -- because I don't have to do any code when working in Muse and don't work with any text editor, I am not sure how this gets accomplished. It seems like it should all happen on the jot form page. I may have to think up my own work-around

  • MGSI

    We are having a Thanks you page designed and need to make some changes to the layout, I tried this option but the lead filled is not leading to my mail id

  • jeffwatson

    when im in notepad, how do i save it as an html file?

  • jrkconsult

    Pastie Code is NOT valid and it's in spanish...

  • dennis

    hullo there

  • sadasd

    hey

  • adminuoem

    good

  • Kevin Robertson

    thanks

  • UBTMarketing

    Hello JotForm,

    hoping you can help me here... is there any way we can have it come up with the thank you message (that looks nice, not just plain text) and then it auto -redirects to our webpage?
    thanks
    Annie.

  • ksesock

    I'm trying to do this on a Conditional Thank You page, in other words, one where the user is diverted based on a condition on the page, and every time I try to save the Javascript, it disappears. Is this no longer possible?

  • carolinasuccessteam

    my webpage will not redirect, i thouhght I did it right..:( dev.carolinasuccessteam.com the form in the middle of the page...THANKS!

  • Free Games Download

    Survey responses are submitted when a respondent clicks the Done button on the last page of your survey—respondents don t need to click the Done button on the page with your Custom Thank You to submit their responses.

  • ashwini

    ok

  • AmSteve

    Is it possible to include the name/value pairs in the same fashion as when prepopulating a form for input?

  • akbar

    sUPER

  • Pharme50

    Very nice site!

  • Pharma827

    Very nice site! cheap goods

  • suganya

    so good

  • sriraga

    Thanks for the Useful Tip

  • padmavathi

    it is very useful

  • magicjack335

    Hi,

    I tried to edit the HTML with your editor so that I could redirect anyone who submits a form back to my page however I am not sure what I am doing wrong, I follow your instructions but when I have done a few test submits it doesnt seem to work.

    I notice when I go into the text editor, after changing it, the HTML looks the same, after saving it, should it look changed..?

    Regards

    Jack