Best you can probably do is to have a timer fire every 15 - 20 seconds,
check if an update has been made, if so send the new information. This is
how Gmail "Drafts" works. Otherwise, maybe you can store the form values in
a JavaScript object onchange, then onunload submit the object. From what
I've read onunload should complete as fast as possible, so, I'm not exactly
sure you want to attach an Ajax Post to this event.

- jake

On 5/30/07, Andy Matthews <[EMAIL PROTECTED]> wrote:


If you find this out, let me know because I'd love to have similar
functionality.

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Gordon
Sent: Wednesday, May 30, 2007 9:27 AM
To: jQuery (English)
Subject: [jQuery] Quick javascript question (not jQuery)


Not strictly speaking a jQuery question but I thought somebody on here
might
have some insight into this. :)

The Powers That Be have asked me for a system whereby the contents of a
form
is automatically saved to the server whenever the user leaves the page.  I
looked into onunload but from what I can asertain by the time that event
fires the form already no longer exists and can't be submitted to the
server.  Doing an AJAX post whenever the form changes isn't acceptible
because that would generate too much database traffic, so I'm kind of
stuck.
I did suggest preservign the data in a cookie instead of the database but
that is apparently not acceptable either.

Is there some other way I could have the form submitted when the user
leaves
the page?




Reply via email to