JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8/jquery.validate.min.js"></script>
<form id="testform">
<input type="text" name="txt_field1" id="txt_field1" />
<input type="text" name="txt_field2" id="txt_field2" />
<input type="text" name="txt_field3" id="txt_field3" />
<input type="submit" />
</form>
JavaScript
$("#testform").validate();
$.validator.addMethod("notaccept", function(value, element, param) {
return value.match(new RegExp("^" + param + "$"));
}, "Only alphabet allowed");
$('input[id^="txt_field"]').each(function() {
$(this).rules("add", { notaccept: "[a-zA-Z]+" });
});