JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css">
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js"></script>
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div data-role="page" id="myformVal">
<div data-role="header">
<h1>My Title</h1>
</div>
<!-- /header -->
<div data-role="content">
<form id="ccform" method="post">
<div data-role="fieldcontain">
<label for="cc">Card Number</label>
<input name="ccc" class="required url" type="text"
id="cc" maxlength="23">
</div>
<div data-role="fieldcontain">
<label for="name">Card Holder Name</label>
<input id="name" class="required" type="text">
</div>
</form>
</div>
<!-- /content -->
</div>
<!-- /page -->
</body>
</html>
CSS
* {
font-family: Verdana;
font-size: 96%;
}
label {
width: 10em;
float: left;
}
label.error {
float: none;
color: red;
padding-left: .5em;
vertical-align: top;
}
p {
clear: both;
}
.submit {
margin-left: 12em;
}
em {
font-weight: bold;
padding-right: 1em;
vertical-align: top;
}
JavaScript
$(document).ready(function () {
$("#ccform").validate();
});