|
Subject:
|
Disabling browser's "X" button
|
|
Posted By:
|
farhanzia
|
Post Date:
|
7/9/2003 9:36:54 AM
|
|
I have a form which holds a close button. I need to know that if there is any way that I can force the user to only close the window through that close button. Behind the button I have called java script "window.close();" after some of my own stuff. My problem is that the user can also close the window through the right top "X" button of browser. Is there any way I can disable or somehow make it non-working? That way I will be sure that the page is always closed through close button provided on the page. Any help will be appreciated.
|
|
Reply By:
|
mussavcom
|
Reply Date:
|
7/9/2003 6:21:33 PM
|
No, you cannot disable the X button, as that is part of the application. Why do you need them to use the button?
|
|
Reply By:
|
cybordax
|
Reply Date:
|
8/17/2004 4:18:24 AM
|
I need to do something similar by intercepting the X button event.
I have a shopping cart in a web site i did. When the user adds something to the cart (and does not buy it) the available stock level is meant to be decremented. Which it does.. BUT if the user clicks X then that decremented item remains as so, and does not get put back into the available stock.... I tried doing something in the global.asa file in the Onsession_end etc but still no joy as the close of the page was overiding everything....
i tried an onunload thing in the body tag but i needed it to open a new window to do some ASP stuff, but most people now have popupstoppers so that killed that idea. i need to to an asp/javascript thing... a javascript function that is called by the unload event,but asp coding within the javascript function....
|
|
Reply By:
|
markerussell
|
Reply Date:
|
3/21/2005 1:21:05 PM
|
Actually i have the same problem. So if you find a way please let me know (mark@russells-pwc.com)
I've put a workaround in using a session file which records what the user has in their cart and i tried to use onsession_end to back out the stock but you cannot do any database stuff in global.asa to what i do is maintain a user count and if it is one then i do some housekeeping and also at a certain point in the site the system checks to see if there are any old session records lying about and clears them up. I set an application to prevent more than one person doing this.
regards
Mark www.russells-pwc.com www.event-travel.co.uk (this is the ticket site for u2 tickets with stock control) www.villacentre.com www.villaworld.co.uk
|
|
Reply By:
|
crmpicco
|
Reply Date:
|
3/23/2005 12:19:43 PM
|
Disabling browser's "X" button = cant be done
www.crmpicco.co.uk www.crmpicco.co.uk.tt www.milklemonadechocolate.uk.tt www.griswolds.uk.tt
|