Here is an easy way to lose data, and its extremely frustrating and is reproduced frequently among my users and occasionally by myself.
Create a new page, type a paragraph, hit preview. Type several more paragraphs, now click a link or hit (in firefox) alt+home. (this is normally done on accident by the user, but can also be done by hitting the "formatting tips" link if they want help)
The obvious consequence is that the user leaves the page. They hit back, to see their work, but because they hit the preview button earlier, when they hit back, drupal has to resubmit the form (as it was before adding the additional paragraphs) causing them to lose all the work they recently did.
Note that under normal circumstances, if the preview button is not used, this data loss doesn't occur. They hit the back button and everything is fine.
* confirm(nag) - warn them that they have unsaved changes, and are they sure they want to leave the page? (blogger, gmail and many other progs do this) - still a hack, but is better than losing data.
* cookie - every 10th key press or something, save the contents of the form to a cook - yuck, but better than losing data.
* save data persistently, either through an automated save draft (gmail does this) and/or a "save and continue editing" button (wordpress does this) - ideal
* redirect after post - that way user's can still use their back button in the normal way - ideal
|#118||form_autosave_garlic-153313-118.patch||33.28 KB||Wim Leers|
|PASSED: [[SimpleTest]]: [MySQL] 50,913 pass(es).|
|#118||interdiff.txt||2.77 KB||Wim Leers|
|#112||form_autosave_garlic-153313-112.patch||31.21 KB||Wim Leers|
|PASSED: [[SimpleTest]]: [MySQL] 50,910 pass(es).|
|#112||interdiff.txt||16.76 KB||Wim Leers|
|#107||drupal-form-data-back-153313-107.patch||29.92 KB||Wim Leers|
|PASSED: [[SimpleTest]]: [MySQL] 50,955 pass(es).|