SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem with accessKey value same letter with lower and upper case

    problem with accessKey attribute value p (lowercase) and P(uppercase) for different html buttons..
    the browser unable to differentiate between upper and lowercase key ...

    i have a simple form with two buttons, and i want to trigger these buttons with keyboard keys in combination with Alt key.
    for example Alt + P (uppercase) should trigger button 1 and
    Alt + p (lowercase) should trigger button 2

    Browser: IE 8.0

    here is the code...
    -----------------------
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title> Alt KeyStrokes </title>
    <body>
    <form method="post" action="">
    <button onclick="alert('Big P');" accesskey="P" >Button1(<u>P</u>)</button>

    <button onclick="alert('Small P');" accesskey="p" >Button2(<u>p</u>)</button>
    </form>

    </body>
    </html>
    ---------------------
    here the behavior is strange, when i press Alt+P in keyboard, button1 is triggered and when i press Alt+Shift+P in keyboard, button2 is triggered .....how to overcome this problem...

    need suggestions

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alt + Shift + p (for uppercase p) should trigger button 1


Bookmarks

Posting Permissions

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