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 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem setting accesskey in IE.

    I've tried:
    Code:
    function add(a, b, c)
    {
     b.onclick=function(){
    top.location.replace('?b=' + a + '&e=' + c);
    };
     b.accesskey='';
     window.open('?add=' + a);
     d.b.focus();
    }
    and:
    Code:
    function add(a, b, c)
    {
     b.onclick=function(){
    top.location.replace('?b=' + a + '&e=' + c);
    };
     b.setAttribute('accesskey','')
     window.open('?add=' + a);
     d.b.focus();
    }
    I thought maybe it was because it was passed to a function, but the onclick part of it works... Thank you in advance.

  • #2
    Senior Coder
    Join Date
    Feb 2006
    Location
    USA
    Posts
    1,013
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Where is "d" set?
    Why didn't you specify the second argument for replace()?
    d.b.focus(); is probably invalid.

    Please read Guidelines and Suggestions for Posting on Web Development Forums.
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions
    Java != JavaScript && JScript != JavaScript
    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

  • #3
    New Coder
    Join Date
    Jul 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Response.

    d is set in the body of the document, and d.b.focus() works because b is a focusable element of form d. The replace() part of it works correctly too; top.location.replace(var) is the same as location.href=var . But please do focus on the accesskey problem. Thanks.

  • #4
    Senior Coder
    Join Date
    Feb 2006
    Location
    USA
    Posts
    1,013
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's not working because accesskey (all lower-case) is not the same as accessKey (camel-case).

    P.S. I forgot about location's replace() method. I was thinking that you were using String's replace() method.

    P.P.S. So you didn't read the guidelines and suggestion page?
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions
    Java != JavaScript && JScript != JavaScript
    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

  • #5
    New Coder
    Join Date
    Jul 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I read it, but I thought I haVe posted all information pertinent to my bug... Or is that not what you were talking about?


  •  

    Posting Permissions

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