I'm having hard time trying to figure out how to auto-save user data in a form when the browser is being closed or user changes the page. The onBeforeUnload event is OK when you want to open a dialog box, but by then it's too late to save the changes (except if you just block the browser in the onBeforeUnload handler long enough for it to pass the request to the server...but I'd rather not do that).
I am sure some of you have had to deal with the unsaved form problem. What do you do? Do you:
- let users just lose their changes,
- ask them using a modal window if they are sure they did the right thing,
- save individual fields on the fly as they change,
- or do you have some ultimate method to automagically save the data when it's about to be lost irretrievably?