Objective:
To create a simple comment form and validate with jQuery.
Skill Set:
jQuery, HTML, CSS
Demo:
Simple Comment Form with validation using jQuery
Steps:
- Download jQuery library here.
- Download jQuery Form Validation plugin here.
- Insert this code within the header tag:
- <script src=”jquery-1.3.2.min.js” type=”text/javascript”></script>
<script src=”jquery.validate.pack.js” type=”text/javascript”></script> - Insert the following code within the header for the plugin:
$().ready(function() {
// validate the comment form when it is submitted
$(“#commentForm”).validate();
});