title: validation in dynamic Form with options required (jQuery)?
body: <p>I'm trying to make a form where "offer" is chosen, and if "rent" option is chosen, then it makes the "flatrent" required, but if "sale" is chosen then it makes the "saleflat" required. I don´t know how to do this.</p>
  
  <p>I'm using the jQuery Form Plugin.</p>
  
  <pre><code>       &lt;form id="item" name="item" method="post" action=""&gt;                            
          &lt;fieldset&gt;
          &lt;h3&gt;Type&lt;/h3&gt; 
          &lt;label for="property_type"&gt;offer&lt;/label&gt;  
          &lt;div class="input"&gt;
          &lt;select id="property_type" name="property_type"&gt;    
          &lt;option selected="selected" value=""&gt;Select your offer&lt;/option&gt;
          &lt;option value="rent"&gt;rent&lt;/option&gt;
          &lt;option value="sale"&gt;sale&lt;/option&gt;
          &lt;/select&gt;
          &lt;/div&gt;
          &lt;/fieldset&gt;
  
          &lt;fieldset class="rent clearfix hide"&gt;
            &lt;label for="requiered by rent"&gt;show + requiered by rent&lt;/label&gt; 
            &lt;select id="rentflat" name="rentflat"&gt;
            &lt;option selected="selected" value=""&gt;Select&lt;/option&gt;
            &lt;option value="1"&gt;condition 1&lt;/option&gt;
            &lt;option value="2"&gt;condition 2&lt;/option&gt;
            &lt;/select&gt;
          &lt;/fieldset&gt;
  
          &lt;fieldset class="sale clearfix hide"&gt;
            &lt;label for="requiered by sale"&gt;show requiered by sale&lt;/label&gt; 
            &lt;select id="saleflat" name="saleflat"&gt;
            &lt;option selected="selected" value=""&gt;Select&lt;/option&gt;
            &lt;option value="1"&gt;condition 1&lt;/option&gt;
            &lt;option value="2"&gt;condition 2&lt;/option&gt;
            &lt;/select&gt;
          &lt;/fieldset&gt;
  
          &lt;button type="submit" class="btn"&gt;inserieren&lt;/button&gt;
  
        &lt;/form&gt;
  </code></pre>
  
  <p>my validation script </p>
  
  <pre><code>      $(document).ready(function () {
            $("#item").validate({
                rules: {
                    property_type: {
                        required: true,
                        rentflat: {
                            depends: function () {
                                return $('#item select[name="property_type"]').val() === 'rent';
                            }
                        },
                        saleflat: {
                            depends: function () {
                                return $('#item select[name="property_type"]').val() === 'sale';
                            }
                        }
                    },
                    messages: {
                        property_type: "offer is required!",
                        rentflat: "rentflat is required!",
                        saleflat: "saleflat is required!"
                    }
  
                }
            });
        });  
  </code></pre>
  
  <p>an life example is here <a href="http://jsbin.com/IkuFIci/2/edit?html,js,output" rel="nofollow" title="jsbin">jsbin</a></p>