title: How can I add a check if a signature is entered using jquery validation and signature_pad?
body: <p>I'm using <a href="https://github.com/jzaefferer/jquery-validation" rel="nofollow">jquery.validate.js</a> to validate multiple fields in my form along with <a href="https://github.com/szimek/signature_pad" rel="nofollow">smizek's signature_pad</a>. I want to validate if something is drawn on the html canvas (signature pad) at the same time all the other input fields are validated.</p>
  
  <p>Unfortunately, adding a function to the jquery validation submithandler to check if the canvas has a signature is not sufficient because this only triggers once all other required fields are satisfied. I can add methods to jquery validator, but I'm pretty sure those only work on validating the content of inputs—not a canvas.</p>
  
  <p>I can check if the signature exists with "signaturePad.isEmpty()". Ideally, there would be a way to add a function like this that happens concurrently with any validation:</p>
  
  <pre><code>    var errorExists = false;
      if( signaturePad.isEmpty()){
        if (errorExists == false){
          $( "#signature-pad" ).append( "&lt;div id="sig-error"&gt;A signature is required&lt;/div&gt;" );
          errorExists = true;
        }
      }else if( !signaturePad.isEmpty()) {
        if (errorExists == true){
          $('#sig-error').remove();
        }
      }
  </code></pre>
  
  <p>...and only continue on to actually submit the form if both the jquery validation and the signature are satisfied.</p>
  
  <p>Is there a way to have a function trigger at the same time other validation happens—not after? How can I stop the form from submitting unless both my conditions are met—not just the jquery validation?</p>