0

i want jsp or javascript for save form data for history -no cookies -no session -no database

when your open form, fill form, submit form... some time user have to come back on form for some change... all field of form with auto fill with old data...(because 28 fields in form)

Ankur Loriya
  • 3,276
  • 8
  • 31
  • 58
  • localstorage? not sure if its cookie-based though – Johan Feb 17 '12 at 11:57
  • Why no cookies, session or database? Your question is essentially _"how do I do this common thing, but without using any of the best-practice tried and tested methods?"_ – Widor Feb 17 '12 at 12:00

4 Answers4

3

If you are using HTML 5. You can employ HTML5's Local Storage.

localStorage.setItem("name", "Hello World!"); //saves to the database, key/value
document.write(localStorage.getItem("name")); //Hello World!
localStorage.removeItem("name"); //deletes the matching item from the database
Ajeesh M
  • 2,092
  • 1
  • 14
  • 18
1

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 key1
localStorage.removeItem("key1"); //deletes the matching item from the database
Pulkit Goyal
  • 5,604
  • 1
  • 32
  • 50
vijay
  • 11
  • 2
0

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.

Community
  • 1
  • 1
Stefan
  • 5,644
  • 4
  • 24
  • 31
0

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.

Matt Gibson
  • 14,616
  • 7
  • 47
  • 79