Blog

How to block numbers in a textbox using Jquery

Posted by : Leo T Abraham on 14 January, 2014

Assign the class numblock to the text field in which you want to block numbers and use the following function, to block numbers using Jquery.

$(function() {
        $('.numblock').bind('keyup blur', function() {
                $(this).val($(this).val().replace(/[^a-z]/g, ''));
         });
});