Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
| Search | Today's Posts | Mark Forums Read
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 9th, 2003, 09:36 AM
Registered User
 
Join Date: Jul 2003
Location: Karachi, Sindh, Pakistan.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Disabling browser's "X" button

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.
  #2 (permalink)  
Old July 9th, 2003, 06:21 PM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No, you cannot disable the X button, as that is part of the application. Why do you need them to use the button?

  #3 (permalink)  
Old August 17th, 2004, 04:18 AM
Registered User
 
Join Date: Aug 2004
Location: , , United Kingdom.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cybordax
Default

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....


  #4 (permalink)  
Old March 21st, 2005, 02:21 PM
Registered User
 
Join Date: Mar 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to markerussell
Default

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

  #5 (permalink)  
Old March 23rd, 2005, 01:19 PM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser's BACK Button Problem phungleon Classic ASP Databases 6 May 16th, 2005 03:10 PM
How to disable browser's refresh button ? sherbir Javascript 3 September 15th, 2004 11:42 PM
Disabling browser's window "X" button farhanzia Classic ASP Professional 1 July 9th, 2003 06:29 PM
Disabling browser's "X" button farhanzia Javascript 1 July 9th, 2003 10:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.