title: jQuery validation - changing value of max at runtime
body: <p>I have these validation rules: </p>
  
  <pre><code>$("#ed_details").validate({
      rules: {
          tagno: { required: true },
          itemid: { required: true },
          ralno: { required: true },
          feet: { required: true, number: true, min: 0 },
          inches: { required: true, number: true, min: 0 },
          cms: { required: true, number: true, min: 0 },
          length: { required: true, number: true, max: $('#maxlength').val() },
          qty: { required: true }
      }
  });
  </code></pre>
  
  <p>This is the field that lengths validates against.  It is text only for testing purposes.  It will be hidden once this is working.</p>
  
  <pre><code>&lt;input type="text" name="maxlength" id="maxlength" value="&lt;?=$maxL['ml']?&gt;" /&gt;
  </code></pre>
  
  <p>This works fine unless I change the value of maxlength at runtime (which can happen).  The user is selecting an item from a drop down.  Each item has a maximum length of tubing that can be used with it.  When the item changes, the value of maxlength does change on the screen.  However, when the validation runs, I see an error message based on the original length (0 for a new item, whatever the maxlength was at load for an edit).</p>
  
  <pre><code>Please enter a value less than or equal to 156.
  </code></pre>
  
  <p>I see this even when the maxlength field shows another value.</p>
  
  <p>If I use Firebug on the field, it shows the original value even after it has been changed.  Also, changing the maxlength field by hand instead of code does not make a difference.</p>
  
  <p>Any help is greatly appreciated.</p>