views:

318

answers:

4

I have an issue with a task management application where occasionally users close their browsers/tabs and the information which they type goes away because they accidentally close a browser/tab, resulting in the loss of the text which they've entered ( and some can spend half an hour entering in text ).

So I have to provide a solution, I have a couple ideas but wanted input on the best to go with, or if you have a better solution let me hear ya.

Option 1:

  • On the window.onunload or possibly window.onbeforeunload event invoke a confirm() dialog and first test whether the task logging area has any text in it and is not blank. If it's not blank, invoke window.confirm() and ask whether the user wants to close the tab/window without saving a log.

My concern with option #1 is that it may be user intrusive.

Option 2:

  • On the same event, don't invoke any confirm() but instead forcefully save the text in the task logging area in a cookie. Then possibly offer a button that tries to restore any saved task information from the cookie on the same page, so hitting that button would make it parse the cookies and retrieve the information.
+1  A: 

I would research AJAX frameworks for the particular web server/languages you are using. AJAX would allow you to save form data as it is typed (for example, this is how Google Docs works).

RichAmberale
I know how to do this but I feel it would heavily clog the server - I mean.. binding a keyup event for dozens of users and sending an ajax request every couple of seconds for every user?
meder
You don't have to do it on keyup, you could just do it on blur. That at least implies that the user has finished what they were doing in that particular field and that it's worth saving.
Stephen Caldwell
Right..maybe "As it is typed" is too much. If you did it on a timer every 60 seconds, every 5 minutes, etc if and only if the text has changed, that might also work for your scenario.
RichAmberale
+1  A: 

Cookies seem most sensible...but what if Cookies are disabled?

Did you consider using dynamic hidden form-fields?

Shankar Ramachandran
I'd say 99% of the people using this have cookies enabled. I don't see how language is relevant, I know how to do the programming but PHP would be the language.
meder
Then cookies are the way to go..simple and efficient!
Shankar Ramachandran
The reason I asked language is because you have not tagged it appropriately (it is a godd practice to tag the platform...ppl will easily find it)...and there other web-platforms where more options are available
Shankar Ramachandran
Cookies aren't good because they don't give the user instant feedback they made a mistake.
ck
+2  A: 
JonoW
+2  A: 

If the user is daft enough to navigate away before submitting what they have been doing, then they shouldn't mind an intrusion to ask if they mean to do something that is apparently stupid.

Also, SO uses a confirmation dialog on navigating away, and most (some) users here are pretty smart.

This is the easiest to use, and will probably help the users more.

If someone writes a long piece of text, then closes the browser without submitting it, they might be more pleased to sort the problem there and then rather than finding out the next morning they didn't do it...

ck