Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    pressing TAB exec function

    // i would like to execute function pressing TAB on my form
    // it works well in IE, but not in NS6+
    // could you add some lines for resolving my problem
    // thanks

    function ShowTabWnd(srcUrl,obj,w,h) {
    if (window.event.keyCode == '9') {
    window.open(srcUrl+obj,'_blank','resizable=no,scrollbars=yes,height='+h+',width='+w);
    }
    }

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    need to use cross browser code

    http://www10.brinkster.com/A1ien51/Scripts/KeyCode.htm

    Eric

  • #3
    New to the CF scene
    Join Date
    Oct 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by A1ien51
    need to use cross browser code

    http://www10.brinkster.com/A1ien51/Scripts/KeyCode.htm

    Eric
    well, i need to pass some arguments too i.e: srcUrl,obj,w,h
    if you will so kind & add some lines to my code

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    You need to pass event to the function:

    function ShowTabWnd(srcUrl,obj,w,h,evt) {
    var code = (window.event) ? window.event.keyCode:evt.which;
    if (code == '9') {
    window.open(srcUrl+obj,'_blank','resizable=no,scrollbars=yes,height='+h+',width='+w);
    }
    }

    onkeypress="ShowTabWnd(..., ..., ..., ..., event)"


  •  

    Posting Permissions

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