title: jQuery Validation ONLY when certain radio buttons selected
body: <p>I have this simple bit of validation on my form:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
                      $(function()
                      {
                          $("#postform").validate({
                              rules: {
                                  post_title: "required",
                                  post_url: "required",
                                  post_code: "required",
                                  post_content: "required",
                                  post_tags: "required"
                              }
                          });
                      });
  
                      &lt;/script&gt;
  </code></pre>
  
  <p>BUT I don't want to require post_url or post_code if certain radio buttons are not checked as they get hidden when I select them. e.g. here are the radios:</p>
  
  <pre><code>&lt;li&gt;&lt;label for="r1"&gt;&lt;input type="radio" name="post_category" id="r1" value="12" checked="checked" /&gt; Share an Article&lt;/label&gt;&lt;/li&gt;
                                      &lt;li&gt;&lt;label for="r4"&gt;&lt;input type="radio" name="post_category" id="r4" value="14" /&gt; Share a Link&lt;/label&gt;&lt;/li&gt;
                                      &lt;li&gt;&lt;label for="r3"&gt;&lt;input type="radio" name="post_category" id="r3" value="13" /&gt; Share some Code&lt;/label&gt;&lt;/li
  </code></pre>
  
  <p>and then this is the jquery code that hides or shows them:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      jQuery(document).ready(function($)
      {
          $("input[name='post_category']").change(function()
          {
                  $("#discussion-label").toggle(this.value == "12");
          });
          $("input[name='post_category']").change(function()
          {
                  $("#code-container").toggle(this.value == "13");
                  $("#code-label").toggle(this.value == "13");
          });
          $("input[name='post_category']").change(function()
          {
                  $("#link-container").toggle(this.value == "14");
                  $("#link-label").toggle(this.value == "14");
          });
  
          $("input#r1:checked").change();
          $("input#r3:checked").change();
          $("input#r4:checked").change();
      });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>So the idea is that when user chooses the first radio button only post_title, post_content, and post_tags will be validated. If the user chooses the second radio button the it wil ALSO validate the post_url field, if they choose the third radio button then it will validate the post_code field BUT NOT the post_url anymore and vice-versa.</p>
  
  <p>Can anyone help? Thanks</p>