SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    May 2006
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to disable browser navigation

    Hi.
    I have a quiz application made in PHP. The quizzes have a time limit, and i display the time left using javascript in a textfield. I always initialize the timer on document load. I also have a page navigation that switch between pages, and i maintain the time value from the last page.
    Now the problem is that if the user clicks on back button of the browser and after on forward, the timer gets reinitialized with the start time, and in this way he can cheat.
    Can you please tell me how can i disable all navigation on my page?

  2. #2
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,423
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    You would have to open that page up in a new window and disable the navigation bar that way. Otherwise you can't turn off navigation in a user's main browser window.

  3. #3
    SitePoint Addict Mirek Komárek's Avatar
    Join Date
    Dec 2006
    Location
    Prague
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    location.replace will forget history, so user will be not able to use back button. http://www.webreference.com/js/tips/990923.html

  4. #4
    SitePoint Enthusiast
    Join Date
    May 2006
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can i use location.replace with form submitting ? The problem is that i have to save all the data entered on the page, so doing just a location.replace won't help.


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
  •