SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Saving unfinished work automatically

    Hello,
    Say if an author is writing an article into the form, and for some reason he goes get a drink or doing something away from pc without saving his unfinished work. Is there a way to save it automatically,say after 15 minutes sitting there dormant?

    Thanks in advance,
    John

  2. #2
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I reckon you could come up with some event driven javascript that would submit the form. That would be a challenge - because you will be trying to time how long its been since the last key press and after that counter reaches your limit that would trigger the form.submit .

    This could end up being better answered in the client side forum. I'll leave it here for the moment - to see what others think is the solution, but might move it over a bit later on if that seems the right direction to take.

  3. #3
    SitePoint Zealot moshe_be's Avatar
    Join Date
    Dec 2000
    Posts
    169
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It won't be possible to do with server-side scripting. once the page got to the client the server part is done.

  4. #4
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    couldn't you use sleep() for this?
    so, once the author loads the script have it spit out that if your inactive for 15 mins, it'd submit it.
    but yea, now that i think about it, you'd need to use a js to actually submit the form itself though wouldn't you?
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  5. #5
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's entirely possible using Javascript: just something like: <body onLoad="('document.forms[0].action=\"savepage.blah\";document.forms[0].x='save';document.forms[0].submit()',15*60000)"> and use savepage.blah to do whatever you want. As you can see I modified the hidden input "x" so that you'd know that it was an automatic save.
    Last edited by Anarchos; Sep 10, 2001 at 14:35.
    ck :: bringing chris to the masses.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •