This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I want to submit the form in a page when the user press the Browser window 'X' Button.(only press the 'X' button). of course some events like onunload useful but these events are called eac time when not even pressing the X button. i.e. from other source.
The onunload and onbeforeunload are called for anything that causes the browser to leave its current state. Basically there is no easy solution to solving the problem.
Joined: Jul 17, 2005
Thanks for the reply. In my scenario,
One popup window will be opened to edit a form contains some fields to be persisted. in that window I ahve two buttons, one for 'update' and other for 'cancel'. whenever the user press the either buttons there is no problem as Database transactions are maintained and window will be closed. But when the user close the popup by pressing X button of the window(it is usual practice in windows environment. we cannot force the user to use buttons only), the database is locked as there will no action perform to release database lock.