JavaScript dynamically getting the names
<pre><code>&lt;TD class="small" width="13%"&gt;
    &lt;input type="text" id="gardes" 
           name="Names$Dynamic${$Index}$tract$" maxlength="14"  
           style="width:98%" value="{./@tract}"&gt;
    &lt;/input&gt;
&lt;/TD&gt;
&lt;TD class="small" width="12%"&gt; 
    &lt;input type="text" id="gradesfar" 
            name="Names$Dynamic${$Index}$TractFild$" maxlength="14"   
            onchange="validate(this,gardes)"  
            style="width:98%" value="{./@TractFild}"&gt;
    &lt;/input&gt;
&lt;/TD&gt;
</code></pre>

<p>Inside <code>validate(this,gardes)</code> function I want to check which one is greater out of these 2 textboxes.</p>

<p>How do I write the javascript code?</p>

<p>The problem is, the value of index is dynamic it will be keep changing.
With the index if I try it will be always constant. In my case for first instance.</p>

<p>Confusing? Just tell me how I can validate less than or greater than between the values of these two inputs.</p>
