Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Saving form data

 
Timo Tamme
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
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
Sheriff
Posts: 21319
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic