1. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    Is there a way to disable the back button on a browser.
  2. #2
  3. No Profile Picture
    Devshed Newbie (0 - 499 posts)

    You can use the JavaScript function location.replace() to prevent your pages from being added to the window's history object, but you can't disable Back.

    <A href='javascript:self.document.location.replace("nextfile.html");'> Click here! </A>

    Then when the user gets to nextfile.html, he or she can't use Back to get to previousfile.html.

  4. #3
  5. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    You can also disable it by leaving from a dummy page immediately to the real page. When users try to go back, they keep getting immediately pushed forward again.

    Keep in mind that it is very user-unfriendly to do this except in very special circumstances.

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    <script language="JavaScript" type="text/javascript">
    setTimeout ("leave()", 100);
    function leave() {

Similar Threads

  1. server side validation - back button loses values
    By leeolive in forum ASP Programming
    Replies: 2
    Last Post: November 2nd, 2003, 08:06 PM
  2. How to trap the 'back' button
    By CandaceDixon in forum HTML Programming
    Replies: 0
    Last Post: October 31st, 2003, 12:27 PM
  3. back button after logout
    By Rman in forum PHP Development
    Replies: 0
    Last Post: August 18th, 2003, 03:17 PM
  4. Header Redirects & The back button...
    By jbuckle24 in forum PHP Development
    Replies: 2
    Last Post: August 28th, 2001, 10:21 AM
  5. sessions and browser back button, part II
    By 7stud in forum PHP Development
    Replies: 0
    Last Post: March 5th, 2001, 06:08 PM

IMN logo majestic logo threadwatch logo seochat tools logo