I have a Javascript function to permit only numbers in a input.
<input name="onlynumbers" type="text" onkeypress="return isNumber(event);">
This is my Javascript function:
function isNumber(e) {
k = (document.all) ? e.keyCode : e.which;
if (k==8 || k==0) return true;
search = /[0-9]/;
n = String.fromCharCode(k);
return search.test(n);
}
But now I need to permit numbers and also "K" character. I was trying to modify it but I couldn't get it.
May you help me please?
Thanks you! :)