The Problem is that the alert
halts execution of the code, so the second onkeyup
is not called. By changing the function to
function KeyCheck(e)
{
var KeyID = (window.event) ? event.keyCode : e.keyCode;
switch(KeyID)
{
case 18:
document.Form1.KeyName.value = document.Form1.KeyName.value+"Alt";
break;
case 17:
document.Form1.KeyName.value = document.Form1.KeyName.value+"Ctrl";
break;
}
}
we can see that both Alt
and Ctrl
get called.
Tested with Firefox 22 and IE 9.