Jquery Form Validation - using if statement for validation?
<p>I have a form that I am using jquery/mail chimp.  </p>

<p>A portion of the form is hidden and shows (using Jquery Slide()) if a radio button is checked.</p>

<p>Every thing works great as it should.</p>

<p><strong>The Problem:</strong></p>

<p>The form sets to validate the sections that are hidden as well. However some users will not always check the radio button meaning that the form will faulter because the hidden forms will not validate since they are not filled in.</p>

<p>Does any body have any work arounds on this?</p>

<p>Here is the code. </p>

<p>The trigger (shows the rest of the form.)</p>

<pre><code>&lt;div id="accordionup"&gt;
    &lt;li&gt;
        &lt;input name="group[5]" type="radio" id="mce-group-5-1"         value="32"checked="checked" /&gt;
      &lt;label for="mce-group-5-1"&gt;No
    &lt;/li&gt;
 &lt;/div&gt;
</code></pre>

<hr>

<p>When the user selects the radio button the form below slides down. All I would need it to do is add <code>class="required"</code> to a couple (this is key too) not all the fields that slide down. So essentially some kind of conditional/if statement. </p>

<pre><code>&lt;div id="accordion"&gt;
                     &lt;div class="mc-address-group"&gt;
                              &lt;li class="statefield"&gt;
                                    &lt;label for="mce-MMERGE1-state"&gt;State:&lt;/label&gt;
                                    &lt;input type="text" value="" maxlength="20" name="MMERGE1[state]" id="mce-MMERGE1-state" class="" /&gt;
                                &lt;/li&gt;
                                &lt;li class="zipfield"&gt;
                                    &lt;label for="mce-MMERGE1-zip"&gt;Zip Code:&lt;/label&gt;
                                    &lt;input type="text" value="" maxlength="10" name="MMERGE1[zip]" id="mce-MMERGE1-zip" class="" /&gt;
                                &lt;/li&gt;
                                &lt;li class="countryfield"&gt;
&lt;/div&gt;
</code></pre>

<p>I am using this for the slide down</p>

<pre><code>&lt;script&gt;
$('#accordion').click(function() {
  $('#slider').slideDown('slow', function() {

  });
});

$('#accordionup').click(function() {
  $('#slider').slideUp('slow', function() {

  });
});

&lt;/script&gt; 
</code></pre>

<p>Thank you. </p>
