JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8/jquery.validate.js"></script>
<form id="myform" >
<input class= "dossier" type="text" value="type a state abbrivation here" />
</form>
JavaScript
jQuery.validator.addMethod("dossier", function(value) {
var states = ['PA', "CA"]; // of course you will need to add more
var in_array = $.inArray(value.toUpperCase(), states);
if (in_array === -1) {
return false;
}else{
return true;
}
}, "Data provided is not a valid sate");
$("#myform").validate();