Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
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
 
Old September 15th, 2004, 12:26 AM
Authorized User
 
Join Date: Jul 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to sherbir
Default How to disable browser's refresh button ?

Hi all,
I am using Javascript in a JSP page.

I want to know whether there is a way to disable the browser's refresh button ?

I searched a lot on google but I could get only the code to disable the forward/back buttons of the browser.

Please help.

Regards,
Sherbir
__________________
Regards,
Sherbir
 
Old September 15th, 2004, 10:14 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

There is no way AFAIK to disable the refresh button, but you can hide it in a new window. But the user can always hit F5 or right-click to refresh....

Why would you want to take away the refresh button anyway?

-Snib <><
http://www.snibworks.com/
 
Old September 15th, 2004, 11:17 PM
Authorized User
 
Join Date: Jul 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to sherbir
Default

Quote:
quote:Originally posted by Snib
 There is no way AFAIK to disable the refresh button, but you can hide it in a new window. But the user can always hit F5 or right-click to refresh....

Why would you want to take away the refresh button anyway?

-Snib <><
http://www.snibworks.com/
Hi Snib,
Well I've read at a number of websites that disabling the user's forward/back/refresh button is a bad programming approach but here in my application, I can't really help it.

Actually, I wanna disable bcoz from a main window, I am opening a new child window where I am storing some data into the database and then I am refreshing the parent.

Problem is that if I refresh the parent (by mistake if a user does), the data is resent to the database.

This is causing the problem and I want a solution 4 this. The window solution u gave is a good 1, but I cannot apply that as I must have the main window in the full browser screen with all functions.

Any further suggessions are most welcome.

Thanx 4 ur time.

Regards,
Sherbir
 
Old September 15th, 2004, 11:42 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

You can add some session variable or some entry in the database on the page load of the Child window. then on the load of the parent window, you can check this flag and decide wheter to update the database or not






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