title: jQuery validate call custom method if other field not empty
body: <p>I am using jQuery validate plugin and I have a custom method where the field I'm validating must be greater than another field. </p>
  
  <p>The problem I face is when the other field is blank (not required), I get a validation message saying the value must be greater than ther other field which has no value. </p>
  
  <p>I need to call my custom method only if the other field has a value or at leat pass validation on that part.</p>
  
  <pre><code>$.validator.addMethod("greaterThan", function (value, element, param) {
      var $otherElement = $(param);
      return parseInt(value, 10) &gt; parseInt($otherElement.val(), 10);
  });
  
  
  
  rules: {
      other_field: {
          required: false,
          min: 0,
          number: true
      },
      my_field: {
          required: true,
          min: 1,
          number: true,
          greaterThan: "#other_field"
      }
  }
  </code></pre>