Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
| Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript 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:38 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, 10:04 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

If you are using IE then you can assign an event handler to the onbeforeunload event. This can run any clear up code necessary.

--

Joe


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
Disabling browser's "X" button farhanzia HTML Code Clinic 4 March 23rd, 2005 01:19 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





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