title: Using Jquery Validation Plugin's required( dependency-expression )
body: <p>I'm using the jQuery Validation plugin, and I'm trying figure out how i can make a name field required if a prefix (Mr, Ms, etc) or a suffix (Jr, Sr, PhD) is selected.  This is what I have:</p>
  
  <pre><code>$('#geninfo').validate({
    rules:{
     firstname: {required: function(element){
        return $("#prefix").val() != " ";
        }
      }
     },
    messages:{
     firstname: 'enter a name'
     }       
   });
  </code></pre>
  
  <p>Here is the HTML:</p>
  
  <pre><code>&lt;ul&gt;
                  &lt;li&gt;&lt;label for="prefix"&gt;Prefix:&lt;/label&gt;
                   &lt;select name="prefix" id="prefix"&gt;
                        &lt;option selected="selected" value=" "&gt;Select One&lt;/option&gt;
                          &lt;option value="ms"&gt;Ms&lt;/option&gt;
                          &lt;option value="miss"&gt;Miss&lt;/option&gt;
                          &lt;option value="mrs"&gt;Mrs&lt;/option&gt;
                          &lt;option value="mr"&gt;Mr&lt;/option&gt;
                          &lt;option value="dr"&gt;Dr&lt;/option&gt;
                      &lt;/select&gt;
                  &lt;/li&gt;
  &lt;li&gt;&lt;label for="firstname"&gt;First Name:&lt;/label&gt; &lt;input type="text" name="firstname" id="firstname" /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;label for="suffix"&gt;Suffix:&lt;/label&gt;
                   &lt;select name="suffix" id="suffix"&gt;
                        &lt;option selected="selected" value=" "&gt;Select One&lt;/option&gt;
                          &lt;option value="jr"&gt;Jr&lt;/option&gt;
                          &lt;option value="sr"&gt;Sr&lt;/option&gt;
                          &lt;option value="ii"&gt;II&lt;/option&gt;
                      &lt;/select&gt;
                  &lt;/li&gt;&lt;/ul&gt;
  </code></pre>
  
  <p>I can't seem to figure out how i would write the js so that it would account for the prefix || suffix.  any clues as to what I am doing wrong?
  thanks in advance.</p>