Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7159829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:17:46+00:00 2026-05-28T13:17:46+00:00

I want to disable or override the default help function of browsers. I tried

  • 0

I want to disable or override the default help function of browsers.

I tried to look at few examples online but they are not working for me.
(The following code is working on Firefox and Chrome but not on Opera and IE)

<html>
<title>
</title>
<body>
    <script src = "jquery-1.7.1.min.js" text="type="text/javascript""></script>
    <script language="javascript" type="text/javascript">           
            document.onkeydown = function(event)
            {
                if(window.event && window.event.keyCode == 112)
                {
                     event.stopPropagation();
                     event.preventDefault();
                     event.keyCode = 0;
                     return false;
                    //document.onhelp = new Function("return false;");
                    //window.onhelp = new Function("return false;");
                    //helpFunction();

                }
                else if(event.which == 112)
                {
                    helpFunction();
                }
            };
            var false_function = new function(){"return false";};
            shortcut.add("f1",false_function);
        var helpFunction = function() {
            alert('help');
        }
    </script>
    <h2>Test</h2>
</body>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:17:47+00:00Added an answer on May 28, 2026 at 1:17 pm

    I’ve found here this code that was clamied to work in each version of IE and FF

    <script type="text/javascript">
    
    function avoidInvalidKeyStorkes(evtArg) {
        var evt = (document.all ? window.event : evtArg);
        var isIE = (document.all ? true : false);
        var KEYCODE = (document.all ? window.event.keyCode : evtArg.which);
    
        var element = (document.all ? window.event.srcElement : evtArg.target);
        var msg = "We have disabled this key: " + KEYCODE;
    
        if (KEYCODE == "112") {
            if (isIE) {
                document.onhelp = function() {
                    return (false);
                };
                window.onhelp = function() {
                    return (false);
                };
            }
            evt.returnValue = false;
            evt.keyCode = 0;
            window.status = msg;
            evt.preventDefault();
            evt.stopPropagation();
            alert(msg);
        }
    
        window.status = "Done";    
    }    
    
    if (window.document.addEventListener) {
        window.document.addEventListener("keydown", avoidInvalidKeyStorkes, false);
    } else {
        window.document.attachEvent("onkeydown", avoidInvalidKeyStorkes);
        document.captureEvents(Event.KEYDOWN);
    }
    
    </script>
    

    Working JSFiddle. Note that you have to test it after clicking the result tab.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to disable the fling gesture of a scrollview and it does not
Is there a way to disable or override the excel and pdf export function
I have few grid items. Depending on the flag, I want to disable some
I want to disable the Charging and Network identification in Windows phone emulator.. Is
I want to disable an input Box AND a button when a checkbox is
I want to disable click on a certain <div> so that when you select
I want to disable all Foreign key constraints and re-enable them after, is there
I want to disable a particular key press in .NET(both VB.NET & C#.NET).``
I want to disable the stack trace getting generated when an exception is thrown.
I want to disable the left bar button when my webview is loading can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.