## Form Validation - setting rules as configuration

Rules are quite customizable and can be expressed in JavaScript sections and not in the code markup.

- form2.html
- Documentation: jQuery Validation "rules" configuration

      $(document).ready(function(){
        var validation = $("#myForm").validate(
          {
          rules: {
            name:  { required: true, minlength: 2 },
            email: { required: true, email: true },
            url:   { required: true, url: true }
          }
        });
      });