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.