I have a page where I will have form values in click event once user click payment button it will go to next page will have payment option to pay. If user click back button it must retain form values or div text values. How to achieve this?
Asked
Active
Viewed 118 times
0
-
Have you considered doing this on one page and just showing the relevant forms and hiding the others using CSS. this keeping the original values in tact but just toggling the display of the other parts of the forms? - You can easily make a back button that will open the previous div with the content and then hid the one you were on – TrojanMorse Oct 23 '15 at 17:45
-
You could store the values in sessions, cookies or a database with temporary tables – timgavin Oct 25 '15 at 15:55
-
that depends on what you want to use them for... in case you want to maintain them for the duration of the session, tab or until clearing cache you can user sessionStorage, LocalStorage or Cookies... if you want it for this instance alone you can pass them as parameters on the url (if they are not objects)... something like: /mypath/?id="bla"&me="bli"&what="who"... or just add them to session storage when you leave page... this will keep them until you clear it or close the tab – Jony-Y Oct 30 '15 at 08:02
1 Answers
0
There are some ways to do this, it depends to the functionality that you need in your application and what kind of experience you will give to your users.
You may have to disable the web browser back page, the back page functionality must be in a submit button to the previous page by posting a form with all the client data and the controls status. how to stop browser back button using javascript
You also can to preserve the status and the info in client side, by using a cookie that you load in the next page start with an status field, to delete it when you need it. How to load values from a cookie to a form which is in wizardpane (dojo)