SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Disable back button in browsers

    Hi, im workin on this application which has transactions related to credit card , what i want to do is disable the back button on the inetrnet explorer. I know how to do this for the key board but the browser back button im not able to. need some urgent help on it. Thanks

  2. #2
    Beer Monster -Ox's Avatar
    Join Date
    Apr 2003
    Location
    sowth afreeka
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I dont belive that there is a way to disable the actual browsers back button
    My postings are a natural product.
    The slight variations in spelling and grammar enhance its
    individual character and beauty and in no way are to be
    considered flaws or defects - http://www.guinnesspig.net

  3. #3
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by avnsngh
    Hi, im workin on this application which has transactions related to credit card , what i want to do is disable the back button on the inetrnet explorer. I know how to do this for the key board but the browser back button im not able to. need some urgent help on it. Thanks

    is there a way to catch when user clicks on the back button of ie. or any browser. or is it possible that he clicks on back and the previous page actually goes for refreshing,

  4. #4
    SitePoint Addict
    Join Date
    May 2000
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it is a form on the previous page could you do a reset of it when the page loads?

    A script like this after the form(bottom of document):
    <script>
    document.form_name.reset()
    </script>

  5. #5
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    -Ox is pretty much right, theres no sure fired way to kill it ..... what I have started to do, on mission critical input forms and applications where I want the to keep moving forward is to load it into a window I create in javascript and remove everything from the window (IE: toolbars, locationbar etc) ...... its not a perfect way to handle it by any stretch of the imagination but it does stop the basic users from "reaching" for that back button ...... but web savy users can always right click and choose "back"

    On our web apps that MAY get screwed up by going back I usually handle this server-side, checking to see if the variable from a form already exists (meaning they have gone back somehow) and then giving the client those variables back into the form.....

  6. #6
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One thing you might want to try is using location.replace()

    Lets say you have 3 pages:
    1 - a store page that has a link to a credit card processing facility
    2 - the credit card facility where the user puts in their info
    3 - the "result" of that facility

    The user can access page 1 whenever they want, page 2 just once, and page 3 whenever they want. You use a normal link from page 1 to page 2, and from page 2 you use location.replace('page3.html') - that way page 2 gets replaced in the user's history with page 3 and pressing "back" from page 3 goes to page 1.

    Follow me? Does that help?

  7. #7
    SitePoint Evangelist NokX's Avatar
    Join Date
    Feb 2003
    Location
    Knoxville, TN
    Posts
    523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you could set up a session variable when they're on page 2, when they hit the back button to page 1, if that session is set just shoot 'em back to page 2. i guess. i've never wanted, or attempted, to have such a setup.

  8. #8
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only *reliable* way to cope with this situation is to deal with it server side. By all means, use client-side scripting as well, if it makes things more user-friendly, but don't rely on it.

  9. #9
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks jim. i tried something like that, it helped alot thanks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •