$(document).ready(function() { $("#myTextBox").inputFilter(function(value) { return /^d*$/.test(value); // Allow digits only, using a RegExp },"Only digits allowed"); });