I want to copy paste numeric values in this field, can we achieve this keeping onkeypress as it is?
HTML:
<input type="text" onkeypress="return allowNumOnly(event);">
Javascript:
function allowNumOnly(evt)
{
var charCode = (evt.which) ? evt.which : evt.keyCode
console.log(charCode);
if(charCode==36 || charCode==46 || charCode==37 || charCode==39)
return true;
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}