I\'d like to use jQuery\'s validation plugin to validate a field that only accepts alphabetical characters, but there doesn\'t seem to be a defined rule for it. I\'ve search
$('.AlphabetsOnly').keypress(function (e) { var regex = new RegExp(/^[a-zA-Z\s]+$/); var str = String.fromCharCode(!e.charCode ? e.which : e.charCode); if (regex.test(str)) { return true; } else { e.preventDefault(); return false; } });