Queston how to disabled?

Discussion in 'PHP' started by lowridertj, Apr 29, 2007.

Thread Status:
Not open for further replies.
  1. #1
    How would I disable refresh / F5 button

    any ideas how I can go about doing this?

    THanks,
    TJ
     
    lowridertj, Apr 29, 2007 IP
  2. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #2
    Found this code in javascript :


    
    
      <script>
    
    if (document.all) {
    
     document.onkeydown = function () {
         var key_f5 = 116; // 116 = F5
    
        if (key_f5==event.keyCode) {
        event.keyCode=0;
        alert ("Sorry! You can not refresh this page!");
        }
     }
    }
      </script>
    
    not sure if this will work on FF  , also user can easily disable javascript .
    
    
    Code (markup):
     
    commandos, Apr 29, 2007 IP
  3. manilodisan

    manilodisan Peon

    Messages:
    224
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Curious why would you want that...
     
    manilodisan, Apr 29, 2007 IP
  4. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #4
    i think to disable the submit form , when you submit a form and u click on refresh it will submit another time ...

    same goes to the back button .
     
    commandos, Apr 29, 2007 IP
    lowridertj likes this.
  5. lowridertj

    lowridertj Well-Known Member

    Messages:
    2,882
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    195
    #5
    reason being I run an online turn based game.

    People F5 enter. as well as have auto refreshers causing them to spin mad fast the turns they have on hand. I want them to have to interact more. and not so much on refreshers.

    I would need something not java as FF uses java for there refresh program

    reload every v2.0

    IE: has some theres are normally web masted with frames. So i used a break frames tech. for that. However needing to stop the outside java scripts and page refreshers.

    Please keep the ideas rolling everyone. and thank you so far.

    TJ
     
    lowridertj, Apr 29, 2007 IP
Thread Status:
Not open for further replies.