473,800 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disabling the browser's 'Back' button

When designing a webpage, is there a way to disable the back button? It
must be possible.

I am asking because there are certain web applications that I have used that
require the user to never press the back button from certain screens. If
the back button is pressed, it will bill for charges, even if the user is
pressing the back button as a way of canceling. Another example would be
Mambo CMS -- if you click the back button on certain screens it checks out
the content and you have to do a 'global checking' to unlock it which can
cause other problems if not done right.

I'm hoping there is a way to fix this. Otherwise, maybe there is a way to
get rid of the back button with javascript without opening a new window? I
don't want to get rid of the toolbar, but just to disable that feature.

Any tips would be appreciated.


Jul 23 '05 #1
9 3635
On Sun, 26 Sep 2004 20:32:40 GMT, jcnews wrote:
..is there a way to disable the back button?


<http://www.jibbering.c om/faq/#FAQ4_2>

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
Jul 23 '05 #2
On Sun, 26 Sep 2004 20:32:40 GMT, "jcnews" <jc****@earthli nk.net>
wrote:
When designing a webpage, is there a way to disable the back button? It
must be possible.
No, and it's a FAQ, so please see the FAQ at http://jibbering.com/faq/

Jim.
I am asking because there are certain web applications that I have used that
require the user to never press the back button from certain screens. If
the back button is pressed, it will bill for charges, even if the user is
pressing the back button as a way of canceling.


That's a bad e-commerce site, and with an organisation so negligent, I
wouldn't trust them with my credit card details - keep away!

Jim.
Jul 23 '05 #3
jcnews wrote:
When designing a webpage, is there a way to disable
the back button? It must be possible.
You can't so much disable the back button but you can take action that
will break it for some users. Though the fact that you cannot break it
for all users renders the attempt futile.
I am asking because there are certain web applications
that I have used that require the user to never press
the back button from certain screens. ...
There are a surprising number of web application authors who operate
with a disregard for (or ignorance of) the nature of both HTTP and their
web browser clients.

<snip> I'm hoping there is a way to fix this.
It is a matter of designing server-side code that is suited to being
operated over a stateless protocol form a web browser client. Where the
use of a 'back' facility and the re-submission of a form for an action
that has already happened, does not result in the server-side code
attempting something stupid. (it is also off topic for this group)
Otherwise, maybe there is a way to get rid of the back
button with javascript without opening a new window?
You cannot even get rid of the 'back' facility by opening a new window.
I don't want to get rid of the toolbar, but just to
disable that feature.
The tool bar is not the only way of activating the 'back' facility
anyway.
Any tips would be appreciated.


Look into server-side sessions and think about how they can be used to
keep track of the state of the user's interaction with the server.

Client side scripting can contribute nothing to the solution of this
problem.

Richard.
Jul 23 '05 #4


Jim Ley wrote:
On Sun, 26 Sep 2004 20:32:40 GMT, "jcnews" <jc****@earthli nk.net>
wrote:

When designing a webpage, is there a way to disable the back button? It
must be possible.

No, and it's a FAQ, so please see the FAQ at http://jibbering.com/faq/


No? I have visited a number of pages where the back button doesn't
work, how do they do it??

Frances

Jul 23 '05 #5
On Sun, 26 Sep 2004 20:38:59 -0400, Frances Del Rio wrote:
No, and it's a FAQ, so please see the FAQ at http://jibbering.com/faq/
No? I have visited a number of pages


a) UA?
..where the back button doesn't work, ..


Probably a)

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
Jul 23 '05 #6
On Sun, 26 Sep 2004 20:38:59 -0400, Frances Del Rio <fd***@yahoo.co m>
wrote:
Jim Ley wrote:
On Sun, 26 Sep 2004 20:32:40 GMT, "jcnews" <jc****@earthli nk.net>
wrote:

When designing a webpage, is there a way to disable the back button? It
must be possible.

No, and it's a FAQ, so please see the FAQ at http://jibbering.com/faq/


No? I have visited a number of pages where the back button doesn't
work, how do they do it??


Define doesn't work - maybe it was the suggestion in the FAQ to use
replace on every link, maybe it wasn't that it didn't work, but it
didn't go where you expected - IE has some wrong behaviour (in HTTP
terms) whereby it makes new requests when revisiting pages - it
doesn't really disable the back-button.

Jim.
Jul 23 '05 #7


Jim Ley wrote:
On Sun, 26 Sep 2004 20:38:59 -0400, Frances Del Rio <fd***@yahoo.co m>
wrote:

Jim Ley wrote:
On Sun, 26 Sep 2004 20:32:40 GMT, "jcnews" <jc****@earthli nk.net>
wrote:

When designing a webpage, is there a way to disable the back button? It
must be possible.
No, and it's a FAQ, so please see the FAQ at http://jibbering.com/faq/


No? I have visited a number of pages where the back button doesn't
work, how do they do it??

Define doesn't work - maybe it was the suggestion in the FAQ to use
replace on every link, maybe it wasn't that it didn't work, but it
didn't go where you expected - IE has some wrong behaviour (in HTTP
terms) whereby it makes new requests when revisiting pages - it
doesn't really disable the back-button.


ok, next time I see one I will post.. u click on 'back' button and
either it's ignored or simply refreshes current page... I always
assumed this was done w/JavaScript, that it had to do w/history object..

Jul 23 '05 #8
In article <2r************ *@uni-berlin.de>, fd***@yahoo.com enlightened us
with...


ok, next time I see one I will post.. u click on 'back' button and
either it's ignored or simply refreshes current page... I always
assumed this was done w/JavaScript, that it had to do w/history object..


My guess is that if you pulled down the arrow next to the back button and
went back *two* pages, you'd get the content back. ;)

This is easily done with a simple redirect (server-side) or a replace
(client-side), but it doesn't "break" the back button. The button still
functions and the history is not lost.

The history object is not readable or writable by normal client-side JS. The
only thing you can do is use forward and back with scripting.

Server-side code should always allow for refreshing the page (there are
various ways to do that). That said, sometimes people inherit bad code and
need an interim hack. If that is the case, and javascript is guaranteed
(intranet) you can simply replace the contents of the current window,
overwriting history (location.repla ce). Back will still function, but it will
take it to the previous page. You may be seeing sites doing that, too.
This should by no means be considered a permanent fix, IMO. Solid server-side
code negates the need for any of these types of hacks.

--
--
~kaeli~
Acupuncture is a jab well done.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #9
On Sun, 26 Sep 2004 20:32:40 GMT, "jcnews" <jc****@earthli nk.net>
wrote:
When designing a webpage, is there a way to disable the back button? It
must be possible.


See RFC 2616 paragraph 13.13 for what the standard requires.
http://www.ietf.org/rfc/rfc2616.txt?number=2616

It's a bad idea to attempt to block browser Back button (which won't
stop management or customers from asking for it, I learned the hard
way.) I make my form processing resilient to this, treating it as a
race conditon. In past, I have put in a hidden input that was set to
Date/getTime(). Server side could determine if it was a repost by
seeing if it already got that timestamp from that client (KLUGE, I
know.)

---Bruce Wisentaner
---No spam accepted
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
7796
by: Jeelz | last post by:
Hi Guyz, Would appriciate any tip on disabling an ASP.NET LinkButton using client sided code like javascript. My Requirement is such that the user should be allowed to click on the link button only once (viz. he should not be allowed to submit the form twice). This stuff is easy when using a ASP:Button or HTML Button... but a link button has got me wondering how... plz help!
1
252
by: cgia | last post by:
Is it possible to disable the back button of the browser application-wide? Or it must be done in each form? In any case, how?
2
9581
by: Kapil Jain | last post by:
Dear All, I would like to disable back and forward button + Refresh button. Please help in doing this. I want this because i am displaying data from mysql database and on back and forward button complete logic get failed. Also i would like disable save as option + copy & select all option. Please urgently help me.
5
3008
by: ns21 | last post by:
How can the browser back button be disabled If the form is submitting information to other pages or submitting to itself or using redirections. I tried the tweaks like history.forward(1) in each page to prevent user to navigate back but its not very effective. The server side scripting is done using ASP. you may ask that why at first place I want to disable the browser back
11
2242
by: shankwheat | last post by:
I have a function which passes text from txtdebt to debtsbox which works fine. However, I want to add code which examines the value of debtsbox and if any of the values the user entered contain the string "d" then I want to emable rblDebts which is disabled when the page loads. This part is not working (no errors) and I'm not sure why. Thanks. <script type="text/javascript" language="JavaScript"> <!-- Begin oldvalue = "";
0
2521
by: toeffetommy | last post by:
Hello, I need a piece of functionality developed for our Website and I need some technical advice on how get there. Essentially, what I want to develop is a browser-within-browser functionality where the ‘mini-browser’ has similar functionality to a normal browser. Let me explain: Firstly, our website interface will open up in a popup window. All the normal browser toolbars and buttons have been removed from the popup window. It’s...
4
2381
by: vikramkumar | last post by:
Hi all, This is Vikram kumar. In my application i want to disable browser back and forward button using javascript. Please help me, Thanks.
3
2511
by: =?Utf-8?B?cHJhZGVlcF9UUA==?= | last post by:
Hi All, Can anyone please explain me why I am not able to disable Browser caching in ASP.net by writing the following code Response.Buffer = true; Response.ExpiresAbsolute = DateTime.Now.Subtract(new TimeSpan(1, 0, 0, 0)); Response.Expires = 0; Response.CacheControl = "no-cache";
6
1519
by: raam | last post by:
hi, I have an applciation where when i click on "Logout" should disable back button of browser.The page redirects to defaultlogin screen.There the buttons should get disabled. Can any one expalin me the procedure. Thanks & Regards, Raam.
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10275
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.