JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://test.nethop.com/old.jquery.validate.js"></script>
<form id="listing" method="post">
<ul>
<li>
<label for="username">Email *</label>
<input type="text" name="username" id="username" autocomplete="off"
class="email required unique_email" value="test@test.com" />
</li>
<li>
<input type="submit" name="submit" id="submit" class="btn" value="Save"
/>
</li>
</ul>
</form>
CSS
#listing * {
font:14px Arial, Helvetica, sans-serif;
margin:0;
padding:0
}
#listing ul {
list-style:none
}
#listing ul li {
float:left;
clear:both;
margin-top:20px
}
#listing label {
color:#666666;
display:block;
margin-bottom:6px;
font-size: 13px;
font-weight: bold;
}
#listing input[type=text], #listing select, #listing textarea {
width:280px;
padding:6px 7px;
border:1px solid #e4e5e7;
border-top-color:#adadad;
background:#fff;
color:#333
}
#listing input[type=text].phone {
width:50px;
text-align:center;
}
#listing input[type=password], #listing select, #listing textarea {
width:280px;
padding:6px 7px;
border:1px solid #e4e5e7;
border-top-color:#adadad;
background:#fff;
color:#333
}
#listing textarea {
width:380px;
min-height:180px
}
#listing ul ul li {
float:left;
clear:both;
margin-top:5px
}
#listing ul ul input {
float:left;
width:auto;
margin:0 10px 0 0
}
#listing ul ul label {
float:left;
width:auto;
margin:0;
font-weight: normal;
}
#listing input[type=submit] {
float:left;
font-weight:700;
color:#fff;
width:auto;
-webkit-border-radius:2px;
-moz-border-radius:2px;
border-radius:2px;
background-color:#999;
background-image:linear-gradient(top, #999, #808080);
margin:0 0 50px;
padding:10px 20px;
border:0
}
#listing input[type=submit]:hover {
cursor:pointer;
background:#999
}
#listing input[type=submit]:active {
cursor:pointer;
background:#999;
-webkit-box-shadow:inset 0 0 2px 3px rgba(0, 0, 0, .1);
-moz-box-shadow:inset 0 0 2px 3px rgba(0, 0, 0, .1);
box-shadow:inset 0 0 2px 3px rgba(0, 0, 0, .1)
}
#listing .error input, #listing .custom_error input, #listing input.custom_error, #listing input.error, #listing .error textarea, textarea.error {
border-color:#f44
}
#listing .error-message {
color:#f44
}
#listing select {
...
JavaScript
$(document).ready(function () {
var validator = $("form").validate({
onkeyup: false,
onblur: true,
});
if ($(".unique_email").is("*")) {
//remote validation
$(".unique_email").rules("add", {
remote: "http://test.nethop.com/test.cgi",
messages: {
remote: "This email is already in use"
}
});
}
});