Prevent accidental navigation away from posting form

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9103
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

I just implemented a new feature which prevents you from accidently navigating away from a page on ozzu that you are trying to make a new thread in or reply in.

In the past I have losts posts I have written by acciently hitting the back button or by hitting the backspace key on the keyboard when the actual textbox was not selected. Hitting the backspace key is the same as pressing the back button on the browser.

What should happen now is a javascript confirmation box will popup asking you if you really intended to leave the posting page. It allows you to hit cancel so that you do not lose anything you have written.

Please let me know your opinions on this or if you notice any bugs. I have tested with both IE and FF and they work correctly there.

This should work with both the new topic pages, and quick reply. The navigation check will only activate once you have selected the actual textbox where you would write your post / new thread in.
  • Don2007
  • Web Master
  • Web Master
  • Don2007
  • Posts: 4923
  • Loc: NY

Post 3+ Months Ago

It worked.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13506
  • Loc: Florida

Post 3+ Months Ago

Doesn't work in Opera because of no support for onbeforeunload. No big loss for me though.

I've lost long posts (not just here) by accidentally closing the tab or navigating away with a mouse gesture in Opera enough times that I've started to compose long posts in my text editor and save it to my desktop so I can hit CTRL+S periodically.

I wonder if anyone's written a mod for an autosave feature that uses the same drafts created when you hit the Save button in the advanced reply UI. :scratchhead:

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 2 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2015. Ozzu® is a registered trademark of Unmelted, LLC.