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 ”;
}));
});
});

validate mobile number on keypress using jquery
Tagged on:         

Leave your comment