JSFiddle - React, Tailwind, and code Playground

by rwaldron

HTML

<script src="http://ajax.microsoft.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
<FORM action="" method="post" id="submitForm"> 
<LABEL for="firstname">First name: </LABEL><INPUT type="text" id="firstname"/><BR/>
<LABEL for="lastname">Last name: </LABEL><INPUT type="text" id="lastname"/><BR/>
<INPUT type="submit" value="Send" class="sendButton" />
</FORM>

JavaScript

$('[id$="submitForm"]').validate();

$('[id$="firstname"]').rules("add",{
    required: true
});


$("#submitForm").on("submit", function(e) {
    e.preventDefault();
});