title: JQuery Dynamic Class Rules
body: <p>I am trying to figure out how to do a form validation using jquery on dynamically created fields.</p>
  
  <p>The example:</p>
  
  <pre><code>&lt;input type="text" name="field_1" class="validminmax"&gt;&lt;input type="hidden" name="field_1_min" value="0"&gt;&lt;input type="hidden" name="field_1_max" value="10"&gt;
  
  &lt;input type="text" name="field_2" class="validminmax"&gt;&lt;input type="hidden" name="field_2_min" value="0"&gt;&lt;input type="hidden" name="field_2_max" value="10"&gt;
  
  &lt;input type="text" name="field_3" class="validminmax"&gt;&lt;input type="hidden" name="field_3_min" value="0"&gt;&lt;input type="hidden" name="field_3_max" value="10"&gt;
  </code></pre>
  
  <p>....</p>
  
  <p>In the jQuery:</p>
  
  <pre><code>$(document).ready(function(e) {
     $.validator.addClassRules({
        validminmax:{
           required:true,
           number: true,
       minValue: ???,
       maxValue: ???
      }
      });
  });
  </code></pre>
  
  <p>I am trying to figure out how to appropriately use the minValue and maxValue with those other fields (field_*<em>min, field</em>*_max).</p>
  
  <p>So every field_* I would like the corresponding min and max fields applied.  Is there  anyway I could do that?  There are probably better ways to do it than I have currently coded it. Any help would be greatly appreciated.</p>