Process form action on browser close????
Posted on 2004-04-29
I have several pages, each has a form on it. The problem I am having is that people will fill out the form, and rather than hit submit to then write the data to the db, they will just close the window, thinking that their changes are saved. Is there some combination of body onunload and document.form1.submit(); that will force my page to process the form action page prior to closing the browser window?
Here's what I need:
1. User fills out entire form
2. User closes Internet Explorer (alt-F4, click on the x, whatever)
3. document.formname.submit fires
4. Since formname's action is itself, the form action happens, the SQL update statement inside the form action page happens, the rest of the form is displayed with the new information (as it would on a normal submit) for just a second and then the browser window closes
Steps 3 and 4 would happen in the timespan of a second or 2.
Any ideas? I need to be able to capture this data.
Thanks in advance!