I'm having real problems with Firefox and the onKeyPress / onKeyDown event handlers.
Just for a change, both work fine in IE!
The browser seems to totally ignore both events, it doesn't go near the function.
Any suggestions?
Originally I posted in "Browser Issues" as this is a FireFox problem, but I was redirected here, sort of unhelpful, but there you go!
Just for a change, both work fine in IE!
Code:
<script language="Javascript">
function capLock(divID,e){
kc = e.keyCode;
if (kc == 0) kc = e.charCode;
if(kc >= 65 && kc <= 90) {
document.getElementById(divID).style.visibility = 'visible';
} else {
document.getElementById(divID).style.visibility = 'hidden';
}
}
function HideCapLock(divID) {
document.getElementById(divID).style.visibility = 'hidden';
}
</script>
Code:
<span><input name="Password" id="password" type="password" autocomplete="off" length=20 onClick="Javascript:this.value=''" onChange="Javascript:verifyPassword(this.id);" onKeyDown="Javascript:capLock('divCapsLock1',window.event);" onBlur="Javascript:HideCapLock('divCapsLock1');" />
<div id="divCapsLock1" style="visibility:hidden;margin-top:-80px"><img style="margin-left:140px;" src="../images/buttons/caps_lock_right.png" /></div></span>
<span><input name="CPassword" id="cpwd" type="password" autocomplete="off" length=20 onClick="Javascript:this.value=''" onChange="Javascript:verifyPassword(this.id);" onKeyPress="Javascript:capLock('divCapsLock2',window.event);" onBlur="Javascript:HideCapLock('divCapsLock2');" />
<div id="divCapsLock2" style="visibility:hidden;margin-top:-80px"><img style="margin-left:140px;" src="../images/buttons/caps_lock_right.png" /></div></span>
The browser seems to totally ignore both events, it doesn't go near the function.
Any suggestions?
Originally I posted in "Browser Issues" as this is a FireFox problem, but I was redirected here, sort of unhelpful, but there you go!