I can’t trigger a java-script function to alert the event.charCode form within a function by a keystroke in a textfield while using FireFox.
I got this simple function:
function onlyNumbers(){
alert(event.charCode);
}
and in my HTML part:
<input type=”text” onkeypress=”onlyNumbers()”>.Result: Nothing!
Using the same function with “keyCode” instead of “charCode” works fine in IE.
even using this function –
function onlyNumbers(){
alert(“Alert works from within this function in FireFox!”);
}
– works nicely.
And to make it complete:
<input type=”text” onkeypress=”alert(event.CharCode)”> works even in FireFox.
But i can’t trigger this form within a function in FireFox. What’s going on?
Help is appreciated.