title: JQuery validation-select required if checkbox checked
body: <p>using jquery I want to make a selection from a select box required (ie it can't be left as the blank default) if a particular checkbox is ticked. My code:</p>
  
  <pre><code>$(document).ready(function(){
    $("#myForm").validate({
      rules: {
        myDropDown: {
          required: {       
            depends: function(element) {
              return $("#myCheckbox:checked")
            }
          }
        }
      }
    })
  })
  </code></pre>
  
  <p>The html:</p>
  
  <pre><code>&lt;input type="checkbox" name="myCheckbox" id="myCheckbox" value="1"&gt;
  &lt;select name="myDropDown" id="myDropDown"&gt;
    &lt;option value="" selected&gt;&lt;/option&gt;
    &lt;option value="1"&gt;Choice 1&lt;/option&gt;
    &lt;option value="2"&gt;Choice 2&lt;/option&gt;
    &lt;option value="3"&gt;Choice 3&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Not only is the code not working it's throwing out the jquery tabs that I have as the next section of javascript.</p>
  
  <p>Any advice appreciated.</p>
  
  <p>Edit: Now that I've sorted out all my brackets the behaviour now is that it's making the select box a required field whether or not the checkbox is checked - ie the depends part is not working. Other javascript on the page is now working ok.</p>