I am using following code in my-eclipse IDE
.
<html>
<head>
<script>
function isNumberKey(evt){
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)){
return false;
return true;
}
}
</script>
</head>
<body>
<input name="form_number" onkeypress="return isNumberKey(event)" type="text" maxlength="4">
</body>
</html>
This code does not return the proper output when testing on my built-in browser in my IDE
.
I tried to run this snippet on IE (thus using an external browser) and everything seems to work just fine. I feel like there are not mistakes on my code, but I might be wrong. Is my code wrong or is this issue browser related ?