edselweb

Creating a simple comment form with validation using jQuery

In JavaScript, jQuery on November 9, 2009 at 10:48 am

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();
});