Save html-forms data to local disk?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
A question on html-forms:

We have an application where users will get a CD with,
among other things, some html-forms for them to fill in.
When they click the submit-button, the data is transferred
to a webserver php-script that will then process the info.
The forms-definition looks something like this:

<form action=" " method="post">
 <p>Question 1:
 <p><textarea name="reply01" cols="40" rows="5"></textarea>
 <p>Question 2:
 <p><textarea name="reply02" cols="40" rows="5"></textarea>
 <p>Question 3:
 <p><textarea name="reply03" cols="40" rows="5"></textarea>
  ... etc ...
 <p><input type="submit" value="Submit answers!">

Now, my concern is (since there might be quite a lot of data filled in),
if e.g. the internet-connection for some reason is broken
at the moment when the user clicks the submit-button,
there is a risk they will lose all the text and would have to re-type it,
which I would like to avoid, of course.

How can I best solve this issue?

Ideally, I would like to store the info on their local C: drive
before submitting, and automatically retrieve the text if they
later return to the page, but I guess that's not possible from
an html doc, right?

If so, any other suggestions how to resolve this issue?


Re: Save html-forms data to local disk?

grz02 wrote:

Quoted text here. Click to load it

Kind of possible. You could use JavaScript to save info to a local cookie.

Toby A Inkster BSc (Hons) ARCS
Contact Me -

Re: Save html-forms data to local disk?

Thanks for hint, seems like cookie would do the trick then...

Unfortunately, I dont have much experience w client-side scripting,
could someone please provide or point me to some sample-code
I could elaborate on here?


Quoted text here. Click to load it

Re: Save html-forms data to local disk?

Found some very helpful code here:
so that problem is basically solved now.

But just realized I have a follow-up Question:

By experiment, it seems if I have two different
html-docs in the same local directory, say c:\dir
they will share the same cookie-string.

But if I have two html-docs in different local directories,
say c:\dir1 and c:\dir2 , they will have different cookie-strings
stored independently.

So the Question now is:

Is there any way to define a "global" cookie that will
be shared by all documents stored on the local drive,
regardless of the different directory-paths?

And where can I find some documentation that describes
such implementational details?


Site Timeline