How To Store Form Data In Javascript For History Use In Another Page Or Reopen Page
Solution 1:
If you are using HTML 5. You can employ HTML5's Local Storage.
localStorage.setItem("name", "Hello World!"); //saves to the database, key/valuedocument.write(localStorage.getItem("name")); //Hello World!localStorage.removeItem("name"); //deletes the matching item from the database
Solution 2:
Then you can use HTML5. Because there is a facility to store the temporally data and you can get that data into other pages also .
Like this :
localStorage.setItem("key1", "Value1"); //saves to the database, key/value document.write(localStorage.getItem("key1")); //Will print value of key1localStorage.removeItem("key1"); //deletes the matching item from the database
Solution 3:
You can´t track users/visitors without some kind of authentication and that might require sessions/cookies (and databases).
Closing the page/browser ends the session but cookies and localStorage are persistent.
Serialize the form and the use localStorage to save it.
Solution 4:
This is (as far as I am aware) not possible using browser history storage. You would also not want it to be possible, as it means that other people using the same browser could use the back button to get to all of the user's possibly confidential data.
The right way to do this, if you really must, is to use cookies to keep track of the user's session and if they are logged in (and not otherwise), pre-fill the HTML of the form on the server with the information they entered into the database last time.
Post a Comment for "How To Store Form Data In Javascript For History Use In Another Page Or Reopen Page"