How to validate and restrict unwanted character for mobile or phone number field using jquery

$(document).ready(function () {
$(‘#mobile’).keyup(function () {
var $th = $(this);
$th.val($th.val().replace(/[^0-9]/g, function (str) {
return ”;
}));
});
});

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.