title: JQuery validate dynamically add rules
body: <p>I am currently using the validate plugin to validate a form (using ASP.Net controls). I have stripped out the rules from the standard setup within the form.validate method ie:</p>
  
  <pre><code>    $("form").validate({
  
      rules: {
          ctl00$ContentPlaceHolder1$dgQuestions$ctl14$iRadList_Col0: "required"
      }
  
  });
  </code></pre>
  
  <p>I now have these in various functions which add the ruless depending on what button is clicked. This works fine for text boxes, but for a RadiobuttonList when the plugin tries to add the rule there is an error saying the element is undefined.</p>
  
  <pre><code>function addRuleSet() {
      $("#ctl00$ContentPlaceHolder1$dgQuestions$ctl14$iRadList_Col0").rules("add", { required: true });
  </code></pre>
  
  <p>}</p>
  
  <p>I think the problem is that I am using the name attribute (asp puts $ in )to define the group that the radio buttons belong to rather than an id (, but in the static settings all the elements are definied using the name attribute. Anyway I am not sure how to get around adding a rule for a group of associated radio buttons, any advice would be appreciated.</p>
  
  <p>PS I really need to call the RadioButtonList rather than the individual radio buttons.</p>