How to add a "Back Button" to return to previous form page?

  • Henryoy
    Asked on September 11, 2022 at 5:43 PM

    How can I create a button to return to the previous page?

  • Richard_A
    Replied on September 11, 2022 at 6:09 PM

    Hello enriqueyau7,

    Thanks for reaching out to Jotform Support. I understand that you wanted to add a "Back" button on your Form Builder. Please note that adding the Page Break element would automatically create a back button; thus, you don't need to manually add this option. Check out the screencast below:

    Toh31jv Screenshot 10

    If that’s not exactly what you’re looking for, can you explain a bit more so we can help you better?

  • Henryoy
    Replied on September 11, 2022 at 7:09 PM

    I mean the previous page of another web page, not page of the same form.

  • Israel JotForm Support
    Replied on September 11, 2022 at 10:58 PM

    Hello enriqueyau7,

    Thanks for getting back to us. Could you please provide the URL of the Form? for further investigation? please see this related guide about where to find your form URL.

    Once we hear back from you, we'll be able to move forward with a solution.

  • Henryoy
    Replied on September 14, 2022 at 11:51 PM

    My case like this:

    I guess I have form A and form B, if I open the form A with the original link of JotForm and then open form B with a link put on form A, when I use the browser button to return to form A, the fields that were filled autocomplete, because I have the function activated (See the following image).

    1663212403 63229b733ec6f  Screenshot 10

    However, if I embed form A in an external web page and from form A open form B, it is no longer possible to return to form A with the browser button. If it goes back the way you taught me, the fields don't autocomplete. I tried to put a back button with the code <input type="button" name="Submit" onDISABLEDclick="javascriptDISABLED:history.back(-1);" value="Back to previous page">, but the system does not allow.

    Is there a solution for that?


  • Rene JotForm Support
    Replied on September 15, 2022 at 12:56 AM

    Hello enriqueyau7,

    Thanks for getting back to us. Since the issue occurs when the form is embedded in your webpage, could you please try to re-embed the form using the iframe code and see if this would resolve the issue? If the same thing happens again, please share with us the link to your webpage so that we can take a further look.

    I have cleared your form cache to see if this would correct any unnecessary errors on the form.

    Give it a try and let us know how it goes.

  • Henryoy
    Replied on September 15, 2022 at 7:22 AM

    Inserted is the same as embedded, but in both cases it is not by mistake, but because the two forms A and B are within the same parent page, when using the browser back button, it returns from the parent page to its previous page, not from form B to A. To return from form B to A, the only option is to put a button or link back in form B. I put the code for the button:

    <input type="button" name="Submit" onDISABLEDclick="javascriptDISABLED:history.back(-1);" value="Back to previous page">

    and the button appears to come out:

    1663240651 632309cbb6866  Screenshot 10

    but after clicking the width, the button disappears:

    1663240696 632309f8adc29  Screenshot 21

    I go back to the code editor, the code came out reduced:

    1663240758 63230a36060e2  Screenshot 32

    because the following part disappeared:

    onDISABLEDclick="javascriptDISABLED:history.back(-1);"

    When reopening the code in the builder, all the code is gone.

    Form: https://form.jotform.com/221465602435855

  • Carrissa JotForm Support
    Replied on September 15, 2022 at 7:55 AM

    Hello enriqueyau7,

    Unfortunately, it is not possible to add custom JavaScript code in the form for security reasons. If you want to add custom JavaScript code in your form, you need to download your form's full source code and add the JS code. See this guide to know how.

    Please note that once your add custom JS code to the form's source code, you will have to host the form in your own server.

    Reach out again if there’s anything else we can help you with.