Key Map for Help Page

  1. #1

    Key Map for Help Page

    Hi...

    I want to open a page when i press the F1 button..
    plz help me to solve this....
  2. #2
    Hi,

    In IE it can look like this:
    <script type="text/javascript">
        document.onhelp = function() {
            //open window
            return false;
        }
    </script>
  3. #3
    Hi Thank you Daniil

    Its working in IE
    but not working in Mozilla Firefox
    how to make it work on Mozilla Firefox also?


    Thank you in advance..
  4. #4
    Hi,

    google.com helps.

    Here is a solution from
    http://discuss.joelonsoftware.com/de...el.3.533450.23

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    
        <script type="text/javascript">
            var processKey = function (e) {
                if (Ext.isIE) {
                    // IE uses event instead of passed argument.
                    e = event;
                }
    
                if (e.keyCode == 112) {
                    // F1 key pressed. 
                    if (!Ext.isIE) {
                        e.preventDefault();
                    }
                    return false;
                }
            }
            var processHelp = function () {
                return false;
            }
            var doInit = function () {
                // Setup event handlers for help and key presses.
                document.onhelp = processHelp;
                document.onkeydown = processKey;
            }
        </script>
    
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server">
            <Listeners>
                <DocumentReady Handler="doInit();" />
            </Listeners>
        </ext:ResourceManager>
        </form>
    </body>
    </html>
    Last edited by Daniil; Jan 06, 2011 at 2:31 PM. Reason: Minor correction
  5. #5
    Hi daniil
    Thank you very much its working :)
  6. #6
    This thread can be interested for someone who will find the current thread.
    http://forums.ext.net/showthread.php...topEvent-in-IE

Similar Threads

  1. Replies: 1
    Last Post: Feb 03, 2012, 2:36 PM
  2. Replies: 2
    Last Post: May 05, 2010, 10:23 AM
  3. Replies: 9
    Last Post: Mar 01, 2010, 9:49 PM
  4. Replies: 3
    Last Post: Feb 03, 2010, 10:11 AM
  5. Replies: 5
    Last Post: Aug 04, 2009, 10:49 AM

Tags for this Thread

Posting Permissions