Save html-forms data to local disk?

Discussion in 'HTML' started by grz02, Feb 17, 2004.

  1. grz02

    grz02 Guest

    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="http://www.ourdomain.com/receiver.php" 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!">
    </form>

    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?

    TIA,
     
    grz02, Feb 17, 2004
    #1
    1. Advertising

  2. grz02 wrote:

    > 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?


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

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
     
    Toby A Inkster, Feb 17, 2004
    #2
    1. Advertising

  3. grz02

    grz02 Guest

    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?

    Thanks,


    Toby A Inkster <> wrote:

    > Kind of possible. You could use JavaScript to save info to a local cookie.
     
    grz02, Feb 18, 2004
    #3
  4. grz02

    grz02 Guest

    Found some very helpful code here:
    http://www.echoecho.com/jscookies02.htm
    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?

    Thanks,
     
    grz02, Feb 18, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jas Shultz
    Replies:
    0
    Views:
    987
    Jas Shultz
    Dec 3, 2003
  2. sincethe2003
    Replies:
    2
    Views:
    566
    Craig Deelsnyder
    Jul 14, 2004
  3. Replies:
    12
    Views:
    535
    santosh
    Nov 15, 2006
  4. Gelonida N
    Replies:
    5
    Views:
    316
    Tim Chase
    Oct 29, 2011
  5. Jake Barnes
    Replies:
    6
    Views:
    430
    9.co.uk
    Feb 8, 2006
Loading...

Share This Page