1

Here is my problem...

We have a very large Form with many inputs and check-boxes, the problem happen when the user's pc disconnects he then need to restart the form.

After doing many Google searches I've found a few solution but i have no exp using any of the following and would like to know which solution is better used.

  1. Save a session with post variables so that when user returns his data would be saved. (problem is with session destroyed when browser leaves page.)

  2. Save the post variable to a temporary table, and if host name of user is there to populate the form to continue where he left off. (Probably the simplest way)

  3. Session Storage and Local Storage, Both of these seemed like a good alternative but haven't seen any examples or any docs on how this can be used to populate forms.(No Exp with this.)

I'm thinking of using the second option and just wiping that table after 1 hour but would like to know which is better in terms of what is more widely used for this solution.

Thanks

3
  • wouldn't cookies be a good alternative?
    – FabioG
    Feb 12, 2014 at 16:54
  • 1
    The DB option sounds the 'safest'. What if the users browser just decides to quit or crash?
    – putvande
    Feb 12, 2014 at 17:00
  • You have to store php as well as javascript cookies or localstorage if you want this data just for an hour
    – Jain
    Feb 12, 2014 at 17:05

1 Answer 1

1

you can send the data with the onBlur on the textfields with ajax post to a php file which writes them into the session or a coockie or a database. Session ends when the Browser(not the tab) has been closed. Coockie must be aktivated by the user. So i think the temporary table is the best solution for you.

1
  • I think your right, just tested a quick snip and it definitely seem the way to go Thanks For quick response
    – Andre
    Feb 12, 2014 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.