Problem with default behavior of "alt key + other keys" with accesskey attribut

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” >  <u>P</u>  </button>

&lt;button  onclick="alert('Small P');" accesskey="p" &gt;&nbsp;&nbsp;&lt;u&gt;p&lt;/u&gt;&nbsp;&nbsp;&lt;/button&gt;

</form>

</body>
</html>

here the behavior is strange, when i press Alt+P in keyboard uppercase button is triggered rather than lower case and when i press Alt+Shift+P in keyboard lowercase button is triggered rather than upper case…how to overcome this problem…

need suggestions

The alt key is case sensitive. I believe you are misinterpreting what is going on.

If you interchange the two button then everything seems to work as you are expecting but what is actually happening is that ALT+P is actioning the first accesskey with that letter and ALT+SHIFT+P is actioning the last.

Introduce a third button and this becomes more obvious that is happening.

<!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('Small P');" accesskey="p" >&nbsp;&nbsp;<u>p</u>&nbsp;&nbsp;</button>
<button onclick="alert('Big P');" accesskey="P" >&nbsp;&nbsp;<u>P</u>&nbsp;&nbsp;</button>
<button onclick="alert('Third P');" accesskey="p" >&nbsp;&nbsp;<u>p</u>&nbsp;&nbsp;</button>
</form>
</body>
</html>