title: jQuery Validation plugin in ASP.NET Web Forms
body: <p>I would really like use the jQuery Validation plugin in my ASP.NET Web Forms application (not MVC). I find it easier than adding asp validators everywhere and setting the control to validate field on all of them. </p>
  
  <p>I am just having some issues both when setting the class like this  class="required email" which I think has something to do with having a form tag within the main form tag.</p>
  
  <p>I also run into issues when calling the jquery validate using the names which become mangled in an asp control </p>
  
  <pre><code>// validate signup form on keyup and submit
  $("#signupForm").validate({
      rules: { 
          username: {
              required: true,
              minlength: 2
          }, },
      messages: { 
          username: {
              required: "Please enter a username",
              minlength: "username at least 2 characters"
          }, 
      }.
  
  .......
  
          &lt;p&gt;
              &lt;label for="username"&gt;
                  Username&lt;/label&gt;
              &lt;input id="username" name="username" /&gt;
          &lt;/p&gt;
  </code></pre>
  
  <p>because this </p>
  
  <pre><code>&lt;asp:TextBox ID="tbUsername"  runat="server"&gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p>renders as    </p>
  
  <pre><code>&lt;input name="ctl00$ContentPlaceHolder1$tbUsername" type="text" id="ctl00_ContentPlaceHolder1_tbUsername" /&gt;
  </code></pre>
  
  <p>and mangles the name. I can get the ClientID using <code>&lt;%=tbUsername.ClientID %&gt;</code>but that doesn't work with ClientName</p>
  
  <p>Has anyone had any success using the jquery validator plugin with asp.net? 
  If so what about using multiple forms much like using separate validation groups?</p>