JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
How to create history back two pages linkAsked by mgcaledonian13 on November 11, 2015 at 07:19 AM
I want to stop users going back to the form by pressing the browser back button (top left on most browsers).
Being a lazy individual I had not got a button at the bottom of the TY page but would like to add one that takes the user back two pages, the one before the form that has the button that takes them to the form. The order of pages would be Event page -> Form Page -> Thank You Page (button there would be "Return to Event Page") -> Event Page.
I have now added a Button that takes them back to the Event Page via the URL, but to save putting the URL in for each page I was hoping to use the History as per onClick="history.go(-1); . This would allow me to use the same TY for each Event - lazy individual! A new window for TY page would not be good as there would be two pages open for the site.
Is there a way to do this at all?
Hope this makes some sense ??
create how new window back button site same
Unfortunately, this is currently not possible. The behavior of the back button in the browser cannot be modified in JotForm.
Do let us know if you need further assistance.
Yes I appreciate that the back button in the browser cannot be modified but I was hoping that onClick="history.go(-1) could be incorporated into a custom Back button somewhere.
Hi Willy :)
I am just like that - if there is a way to make it work globally it is something that we should utilize and make our life easier.
However, the thank you page wizard strips the js calls within it :(
Now, are you by some chance redirecting them to your own thank you page?
If that is true, it is very easy to add the code there to redirect them page back (-1) or two (-2), etc.
As mentioned if the thank you page is on your website we could add the js there. For example, you could make a general thank you page where you pass the data that you might need, while in the same time you set it up so that it makes them go back 2 steps.
1. create a page such as http://www.mgcaledonian.com/thank-you/
2. Pass the data from your jotform to that page as the user submits the form: Send POST Data From JotForm Using PHP in Custom Thank You Page
3. Have the JS link on the website:
<a target="_blank" href="#" onClick="history.go(-2);">Click here to return to event</a>
With the data passed, you could even pass the URL to return / go to:
<a target="_blank" href="<?php echo $goTo; ?>">Click here for next step</a>
Hope this helps.