www.webdeveloper.com
Results 1 to 15 of 15

Thread: How to Disable the Refresh Button

  1. #1
    Join Date
    Mar 2006
    Posts
    37

    Angry How to Disable the Refresh Button

    Hi,

    I am Sabareeswaren doing an In-House Project. I am currently doing a "Video on Demand" project in that i need to show a movie which should appear for a particular time span, after that i should close. My Problem is while running the movie, if i Press F5 or REFRESH button, the movie get stopped and strarts from the beginning. Please do help me to finish this!!!!!!

    Thnaks in Advance!!!
    Sabareeswaren.

  2. #2
    Join Date
    Sep 2005
    Posts
    128
    here's how you disable f5, how this helps

    <Script language="javascript">
    function checkKeyCode(evt)
    {

    var evt = (evt) ? evt : ((event) ? event : null);
    var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
    if(event.keyCode==116)
    {
    evt.keyCode=0;
    return false
    }
    }
    document.onkeydown=checkKeyCode;
    </script>

  3. #3
    Join Date
    Mar 2006
    Posts
    37

    How to Diable the Refresh Button

    Hi,

    Thank You very much!!!!! Its Working Correctly....... Can you give me the Connection strings for Connecting the database to My Database (MySQL). Please, if you give means i finished my project....... Thank U SOOOOOOOOOOO Much!!!!! Please do help me!!!

    Thanks in Advance!!!!!!
    Sabareeswaren

  4. #4
    Join Date
    Sep 2005
    Posts
    128
    what server side language are you using, is it php or what,
    if php here is a function

    <?php
    function connection()
    {
    $result=mysql_connect('localhost','root');
    if(!$result)
    return false;
    if(!mysql_select_db('you Database'))
    return false;

    return true;
    }
    ?>

  5. #5
    Join Date
    Mar 2006
    Posts
    37

    How to Disable the Refresh Button

    Sir,

    I am using JavaScript sir. my Server side is Asp.net using C#. but i want this in Javascript. Because asp.net doesnot have timer option, that why i switch over to javascript!!!!! Please do help me!!!!!
    Thanks in Advance!!!!
    Sabareeswaren

  6. #6
    Join Date
    Sep 2005
    Posts
    128
    i can help you , but my help would be limited, i can give you an advice, i already did that in javascript connecting to asp.net, the only way to do that is remote scripting and it is more complex that connecting it using asp.net alone, any short comings of asp is supported by javascript, it is also possible, let javascript do the timer then when it reach the time you want it to execute do this in javascript
    example

    window.setTimeout("setUpdate();", 1000);
    //in ten seconds it will call this function to click the button
    //try to make the button width,height to 1 so you wont be able to see it and its color //the color of your background
    function setUpdate()
    {
    document.getElementById("btnUpdateClick").click();

    }

    on the Private Sub btnUpdateClick_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpdateClick.Click
    in the code behind example consist of
    connection blah blah
    end sub

  7. #7
    Join Date
    Sep 2005
    Posts
    128
    i wont be able to answer you after this, im leaving the office, may this help you, maybe tomorrow,bye

  8. #8
    Join Date
    Mar 2006
    Posts
    37

    How to disable the Refresh Button

    Sir,

    Thanks for your Yesterday's reply. But sir, it got refreshed every second, if it refreshed means my movie on that window get restarted every window. Even if i disabled the F5, no action took place. Give your valuble suggestions please.

    Thanks in Advance!!!!
    Sabareeswaren.

  9. #9
    Join Date
    Sep 2005
    Posts
    128
    can you explain why, and maybe you could give me as sample of your work we could do something about your problem, how did your page get refresh evry second, what particular timer do you need, did you use my javascript timer, if you want it to be longer change the value in the setTimeout

  10. #10
    Join Date
    Mar 2006
    Location
    California
    Posts
    306
    Quote Originally Posted by redfox
    window.setTimeout("setUpdate();", 1000);
    This had the timer going for only 1 second. Use this, to change times:

    Code:
    secondsToWait = 10;
    window.setTimeout("setUpdate();", secondsToWait*1000);
    Now just change secondsToWait to the number of seconds that you need it to keep going.
    JS > PHP > Everything

  11. #11
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    Disabling browser functions are always a bad idea.

    1. They annoy your visitors when their browser doesn't function as expected.
    2. Some visitors will just re-enable the function themselves.
    3. Some browsers disallow attempts to block browser functioning.
    Stephen

  12. #12
    Join Date
    Nov 2008
    Posts
    2
    can anyone help me how to refresh manually by using a button for remote system in webpage

  13. #13
    Join Date
    Nov 2008
    Posts
    2
    Join Date: Nov 2008
    Posts: 1

    can anyone help me how to refresh manually by using a button for remote system webpages

  14. #14
    Join Date
    Sep 2008
    Location
    On the Interweb
    Posts
    125
    Try starting your own thread instead of dredging one up that was answered 2 years ago.
    "Why must I be surrounded by frikkin' idiots?!" - Dr. Evil

    "Remember: There are no stupid questions, only stupid people." - Mr. Garrison

  15. #15
    Join Date
    Apr 2013
    Posts
    1
    Hi Redfox,

    many thanks for your script on how to disable the refresh button function (F5).
    that's so short and script, but very very effective.
    many thanks again.......

    Bing

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles