This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

logically disaple the browser back button

 
Greenhorn
Posts: 29
Netbeans IDE Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i want to disable the back button in IE browser.
i have the code but it's not working

logout.jsp



i don't know where to put the script code
it is put in the logout.jsp file or before
please help me out of this
 
Ranch Hand
Posts: 98
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Here the solution for you. nice tutorial!

Luck!
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its probably worth nothing that if a user like me turned up on your site and saw this behaviour, I'd never be back. Sites that alter normal browser behaviour are nasty.

You also probably need to be aware that it is not 100% possible to do this. If I turned up on your site with my default browser (FireFox running no-script) there is no way of preventing me navigating back.

Why do you need to do this?
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please read and learn: InterfaceDesignersRule1
 
Ranch Hand
Posts: 448
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sateesh,

Is your program going to run on the web or for a set of users.

In all my previous projects, we have faced this issue and we have resolved this by patching the browser and remove the back and forward buttons altogether. The users didn't have admin rights and hence could not enable the buttons.

If the project is supposed to run on the web, then better display a message like "Please don't press back or Refresh button" as we see on the payment gateways.

Or you can set a hidden field in HTML and based on its value, invalidate the session if using JSP/Servlets.

One more application on which I worked, the custom server was written which could easily detect if the back or forward buttons have been presed using the hidden variable. I mean server automatically added hidden field in every HTML page that it sent so that the developers needn't worry about this issue.

Hope that helps.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic