> 
> Hi everybody,
> 
> I'  m not sure this is the right list to ask this kind of question but
I don't know where else. We are using html forms to insert and update
news articles (texts) stored in a mysql database. Ever so often one of
our journalists forgets to press the submit button or his computer
crashes and everything written so far is lost. Is it possible to built
something like an "autosave" function that submits the form data
automatically every couple of minutes and updates the database entry?
>       Any hint's where to look up these kind of things?
> 

It is sort of the right place :-)... Because this is a client side
action (at least what triggers it) you are probably going to want to
look to javascript. I believe you can setup timers in javascript that
will trigger actions, that will be the hard part, the easy part is the
action that is triggered is just a standard submit of the form, then the
server side script would just store the info and reprint the form with
the fields filled in the same, which I am assuming you can do.

As a suggestion I would add (at least) two features,

1) a "clock" that displays a form element that is continually updated
with the number of seconds left until the next save (as you will have to
reload the page and there is nothing your journalist will hate more than
being in the middle of a great thought and having his page reload on
him) which brings me to...

2) have a "reset" clock button, so that if the user *is* paying
attention they can reset it so that the refresh doesn't happen...

Which brings me to "not refreshing" since I know you will ask.
Presumably the javascript could build a request and submit it in a
separate object (possibly in a popup window) which would provide all of
the data from the form, the response would be that the form data has
been saved and then wait a second or two and close the window
automatically, then theoretically you wouldn't have to refresh the page.
But now we are getting much more into the Javascript land where I am not
nearly as strong.....

Obviously you should also store some sort of status so that a half story
isn't posted online just because it is saved in the database...

Now that I have thought through it more this is an interesting idea and
I might just have to play around with it :-)...

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to