| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 |
<head> |
| 4 |
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> |
| 5 |
<title>jQuery validation plug-in - comment form example</title> |
| 6 |
|
| 7 |
<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" /> |
| 8 |
|
| 9 |
<script src="../lib/jquery.js" type="text/javascript"></script> |
| 10 |
<script src="../jquery.validate.js" type="text/javascript"></script> |
| 11 |
|
| 12 |
<!-- for styling the form --> |
| 13 |
<script src="js/cmxforms.js" type="text/javascript"></script> |
| 14 |
|
| 15 |
<script type="text/javascript"> |
| 16 |
$(document).ready(function() { |
| 17 |
$("#commentForm").validate(); |
| 18 |
}); |
| 19 |
</script> |
| 20 |
|
| 21 |
<style type="text/css"> |
| 22 |
#commentForm { width: 500px; } |
| 23 |
#commentForm label { width: 250px; } |
| 24 |
#commentForm label.error, #commentForm input.submit { margin-left: 253px; } |
| 25 |
</style> |
| 26 |
|
| 27 |
</head> |
| 28 |
<body> |
| 29 |
|
| 30 |
<form class="cmxform" id="commentForm" method="post" action=""> |
| 31 |
<fieldset> |
| 32 |
<legend>Please provide your name, email address (won't be published) and a comment</legend> |
| 33 |
<p> |
| 34 |
<label for="cname">Name (required, at least 2 characters)</label> |
| 35 |
<input id="cname" name="name" class="required" minlength="2" /> |
| 36 |
<p> |
| 37 |
<label for="cemail">E-Mail (required)</label> |
| 38 |
<input id="cemail" name="email" class="required email" /> |
| 39 |
</p> |
| 40 |
<p> |
| 41 |
<label for="curl">URL (optional)</label> |
| 42 |
<input id="curl" name="url" class="url" value="" /> |
| 43 |
</p> |
| 44 |
<p> |
| 45 |
<label for="ccomment">Your comment (required)</label> |
| 46 |
<textarea id="ccomment" name="comment" class="required"></textarea> |
| 47 |
</p> |
| 48 |
<p> |
| 49 |
<input class="submit" type="submit" value="Submit"/> |
| 50 |
</p> |
| 51 |
</fieldset> |
| 52 |
</form> |
| 53 |
|
| 54 |
</body> |
| 55 |
</html> |