title: jquery-validate - addMethod - how to apply custom rule referencing two text boxes?
body: <p>I'm using the <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" rel="noreferrer">jQuery validation plugin</a> and I want make use of a custom method which takes two the values entered into two different textboxes into account when deciding if the situation is valid.</p>
  
  <p>I know about <a href="http://docs.jquery.com/Plugins/Validation/Validator/addMethod" rel="noreferrer">add method</a> and I've found an example ...</p>
  
  <pre><code>jQuery.validator.addMethod("math", function(value, element, params) { 
   return this.optional(element) || value == params[0] + params[1]; 
  }, jQuery.format("Please enter the correct value for {0} + {1}"));
  </code></pre>
  
  <p>... which references two elements but I'm not clear how to write a rule which would make use of a method such as this ?</p>
  
  <p>To make it easier to discuss imagine that I want to make use of this example method and I've got a form that looks like this ..</p>
  
  <pre><code>&lt;form id="TOTALSFORM" name="TOTALSFORM"&gt;
      &lt;label for="LHSOPERAND"&gt;Input 1&lt;/label&gt;
      &lt;br /&gt;
      &lt;input type="text" name="LHSOPERAND" id="LHSOPERAND" class="required" /&gt;
      &lt;br /&gt;
      &lt;label for="RHSOPERAND"&gt;End&lt;/label&gt;
      &lt;br /&gt;
      &lt;input type="text" name="RHSOPERAND" id="RHSOPERAND" class="required" /&gt;
      &lt;label for="TOTAL"&gt;End&lt;/label&gt;
      &lt;br /&gt;
      &lt;input type="text" name="TOTAL" id="TOTAL" class="required" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I've got other rules that I apply like this :</p>
  
  <pre><code>$("#OPTREASON").rules("add", {
      required: true,
      min: 0,
      messages: {
          required: "Required input",
          min: "Please select a Reason"
      }
  });
  </code></pre>
  
  <p>How can I do something similar to apply the example custom method shown so that 'TOTAL' is checked as being the sum of 'LHSOPERAND' and 'RHSOPERAND'.</p>