title: jQuery Validate: How to validate a non-form element?
body: <p>I have a form that has an attached map. Clicking on the map adds hidden inputs to a div in the form.</p>
  
  <p>I want a validation rule to check whether or not that div has any hidden elements. So far, I've only been able to do this with a dummy element that I have to manually remove before posting the form:</p>
  
  <pre><code>&lt;form action="..." method="post" id="signup"&gt;
    &lt;!-- ... --&gt;
    &lt;div id="zones_selected"&gt;&lt;input type="hidden" name="dummy"&gt;&lt;/div&gt;
    &lt;!-- ... --&gt;
  &lt;/form&gt;
  
  $.validator.methods.zones = function (value, element, param) { return ($zone_holder.find('input[name!=dummy]').length &gt; 0); };
  $('#signup').validate({
    rules: {
      //...
      'dummy': 'zones'
    },
    //...
    submitHandler: function(form) { $(form).find('input[name=dummy]').remove(); form.submit(); }
  });
  </code></pre>
  
  <p>However, these leaves much to be desired for error placement, as my custom validator method doesn't seem to ever trigger the <code>unhighlight</code> function, and I feel dirty for having put in an input solely for form validation (not very unobtrusive). </p>
  
  <p>What I would like is no extra <code>submitHandler</code> and a rule to check the presence of hidden inputs in a div that would have an <code>unhighlight</code> trigger (such that if a user does click on the map--which creates a new hidden input--the message I display telling them to do so will disappear).</p>
  
  <p>What's the best way to accomplish this?</p>