File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Saving form data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Saving form data" Watch "Saving form data" New topic

Saving form data

Timo Tamme

Joined: Nov 10, 2011
Posts: 8
I am quite new at HTML and JavaScript and I make web page, where users can insert some data.
So I have done HTML page, where user can insert different values, but form continues in separate pages. So I have problem that I want to save form data before submitting it. Is this even possible by using JavaScript?
In my dreams the ideal solution would work with saving data to XML and if user is going to previous page of form, it will be initialized from XML by using JavaScript.
Can you give me some ideas / hints to make this solution?
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

The usual way to do that is to store the partial data on the server; when the first page is submitted the server code saves the form data in the user's session and responds by displaying the second page, and so on.

Javascript data is pretty much restricted to one page, and when the page is unloaded its data goes away. There are some mechanisms for storing persistent data in Javascript, of which cookies are the most widely-supported, so if you're really keen on using Javascript instead of the standard server code then look into those.
I agree. Here's the link:
subject: Saving form data
It's not a secret anymore!