Can some event handlers be implemented to prevent lost postings?

cjard

Well-known member
Joined
Apr 25, 2006
Messages
7,081
Programming Experience
10+
On some other pages, like old Windows Update, if you tried to navigate away from the page a dialog would appear saying "Blah blah something bad will happen if you leave, are you sure you want to leave?"


I was thinking about this as I just accidentally lost a post i was making to give a lot of help to a guy - my touchpad went a bit nuts and zapped the mouse across screen as i was trying to click. I ended up clicking a banner ad and the page loaded. On this board in particular (i dont have this problem with other more primitive boards that dont have a richedit textbox to type posts into) i cant just press BACK and get back to the typing i just lost

A similar thing can happen if you transfer focus out of the text box and then press backspace or something...


However it may occur, if the user has done some typing, it would be nice to show an alert saying "If you navigate away from this page, the typing will be lost. OK CANCEL"

Anyone else ever lost a post in this way and wish they'd had this second-chance?
Additionally, to prevent accidental confirmation by key press e.g. pressing space just as the dialog is appearing, you could take note of the time the first dialog is shown, and start a loop whereby if the answer is given within 2 seconds, then says "answer was given too fast, maybe via accidental keypress.. wait 2 seconds then answer if you really want to nav away from the page"

Oops.. ive gone into implementation mode.. :)
 
I don't know about the implementation of the forum ware, but all those things you've described have happened to me too. I have only one little help, that is if you accidently delete whole or part of what you wrote (amazing how often I do that :() you use keyboard shortcuts Ctrl+Z for UnDo and Ctrl-Y for ReDo, multiple levels - try it out.
 
I thought about doing a browser plugin once to handle this - I had the notion that it could sit and watch everything you typed into a certain webpage. Upon nav away from the page, it would save everything you;d typed for a limited period. If you lost your hotmail, (or worse, those mail systems that time out your session WHILE youre writing a mail - oh, its so simple to get around; just save the data in the user's drafts and ask them to log in again.. grrr@web programmers, but i'm wandering..) posting, even the tech support note or letter of complaint to your bank via their web form.. it would be in there as a "saving bacon" thing..

I fell at the first hurdle though: TIME :(

knowing that at least one other person out there has suffered it at some point, i'll see can i make time to look into it again!
 
Back
Top