function allownumbers(e) { var key = window.event ? e.keyCode : e.which; var keychar = String.fromCharCode(key); var reg = new RegExp("[0-9.]") if (key == 8) { keychar = String.fromCharCode(key); } if (event.keyCode == 9) { //TAB is pressed keyCode = 9 for TAB key return } if (key == 13) { key = 8; keychar = String.fromCharCode(key); } return reg.test(keychar); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)