title: Adding a rule for jQuery validation plugin
body: <p>I'm using following rules to validate the username using jQuery validation method. I want to add another rule that username should contain only alphanumeric and underscore character.
  How can i add additional method for that rule. Is it possible that if user gives less than 4 characters, then I print the minimum length error message, and if the user gives invalid characters, then I give the invalid character error message? Thanks.</p>
  
  <pre><code>$(document).ready(function() {
  $("#sform").validate({
              rules: {
                  username: {
                      required: true,
                      minlength: 4
                  }
              },
  
              messages: {
                  username: "Minimum length 4.",              
              }
          });
      });
  </code></pre>