Form Dirty Bit
Feature Request: A Dirty Bit for Forms.
Rationale: As interactive use of forms for things like Wikis, Blog Entries, etc. becomes more common, and as users open more tabs and windows to perform these actions, it becomes increasingly likely that modified data in a form can be accidentally lost when a user navigates away from a page or closes a browser window without submitting the form.
This design issue has been addressed long ago in document-based applications and users are very familiar with a dialog asking them to confirm that they wish to close a window without saving the modified contents.
From my personal experience, I lose more to closing one window with a dirty form than I do closing a lot of tabs at once.
Suggested Design:
On User Action in a form, set a "page dirty" flag. On Submit or Reset, clear the flag.
On any action that closes a document with a form that is dirty, bring up a dialog to ask the user if they really want to close the document. Options should be Close (Continue?) and Cancel.
Sample Dialog Text: Warning: The Form "editform" on Page "Editing Form Dirty Bit - Edit - wiki.mozilla.org" has been modified. Closing the window or navigating away without submitting the form will cause your changes to be lost. Press Close to close the page or Cancel to return to the form."
Considerations: Suggest *not* allowing this to be hooked w/ an event. Spammers would love to be able to prevent you from closing their windows.
Consider Preference to use old behavior.