I have a javascript function in a php file to restrict users from entering only numeric data into textbox which is working fine in chrome from Windows machine. But it is not working while browsing from an Android device using same chrome browser. Already checked that Javascript is enabled in the chrome in the Android Device.
The Javascript in the HEAD section of the php file is like this
<script type="text/javascript">
function isNumber(evt) {
evt = (evt) ? evt : window.event;
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
return false;
}
return true;
}
</script>
Then the textbox
<input type="text" id="text1" name="text1" onkeypress="return isNumber(event)" />
Thanks in advance for any help or workaround