Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

For my web application, I need to store form inputs spanning across multiple pages, until I finally process/manipulate them to produce some results (its mostly formatting the data entered and presenting it in some layout). The options I think I have are -

  1. Keep sending user's inputs to the server, store it there in some database, do the final manipulation there only, and show the result.

  2. Store the inputs in browser's storage as the user fills the forms, and finally use this stored data to manipulate and show results.

I very much want to use the second method, and perhaps a possible way is using cookies, but I'm afraid I might just hit some upper limit of cookie data storage. I'm also open to understanding the merits of the first method, or any third method.

thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
131 views
Welcome To Ask or Share your Answers For Others

1 Answer

Use webstorage (you can client-side store around 5MB of text or binary data)

Firefox demo: http://codebase.es/test/webstorage.html

DOM Storage is supported in these web browsers:

  • Internet Explorer 8
  • Firefox 2 for sessionStorage, 3.5 for localStorage
  • Safari 4

Just google for sessionStorage and localStorage objects.

Also modern webkit browsers supports client-side sql.

Edit:
I'm not sure about what you want to do but using AJAX you can store everything in javascript variables and serverside databases or sessions are a good choice.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...