JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.js"></script>
<form id="registrationform">
<label for="rid">User Id</label><br/>
<input id="rid" name="rid" type="text" class="required"/><br/>
<label for="remail">Email</label><br/>
<input id="remail" name="remail" type="text" class="required email"/>
</form>
JavaScript
$("#registrationform").validate({
rules: {
rid : {
required : true
},
remail: {
required : true,
email : true
}
},
messages: {
rid : {
required : "id can not be empty"
},
remail: {
required: "email can not be empty",
email : "enter a valid email"
}
}
});