How to validate and restrict unwanted character for name field using jquery

$(document).ready(function () {
$(‘#name’).keyup(function () {
var $th = $(this);
$th.val($th.val().replace(/[^a-zA-Z0-9 \`]/g, function (str) {
return ”;
}));
});
});

Leave your comment

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