JSFiddle - React, Tailwind, and code Playground

by chiragvidani

HTML

<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.js"></script>
<form class="form" id="lgcallbackform"  method="post">
    <input type="hidden" name="nospam:blank" value=""/>
    <label for="name"> Name: <span class="error"></span></label>
    <input id="name" type="text" name="name" required />
    <label for="phone"> Phone: <span class="error"></span></label>
    <input id="phone" type="text" name="phone" class="phone"/>

    <input type="submit" value="Request a call back"/>

</form>

JavaScript

$("#lgcallbackform").validate({
   rules: {
     phone: {
       required: true,
       digits: true,
       minlength: 10,
       maxlength: 14
     }
   }
});