//allow a number in textbox using jQuery. $('#valuepoints').keypress(function (e) { var charCode = (e.which) ? e.which : event.keyCode; if (String.fromCharCode(charCode).match(/[^0-9]/g)) return false; });