Process form action on browser close????

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

The only problem with that is that if they actually do click the Submit button, they get the warning too, which would be good for them not to get if they have clicked the button that does save the data. Do you have any idea on how to not show that warning if the submit button is clicked?

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Sorry to be a bother, but I can't get the warning to not come up when I actually click the submit button using either method. Is there anything I would need to know to make either of those lines that create the submit button work?

Featured Post

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition.
To share some of…

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …

The viewer will learn the basics of jQuery, including how to invoke it on a web page.
Reference your jQuery libraries: (CODE)
Include your new external js/jQuery file: (CODE)
Write your first lines of code to setup your site for jQuery.: (CODE)

The viewer will learn the basics of jQuery including how to code hide show and toggles.
Reference your jQuery libraries:
(CODE)
Include your new external js/jQuery file:
(CODE)
Write your first lines of code to setup your site for jQuery…