Jquery - Loop through Checkboxes and Multiple elements
<p>All,</p>

<p>I have a set of elements like this in a form:</p>

<pre><code>&lt;input type="checkbox" name="chk[140]"&gt;
&lt;input type="hidden" value="3" name="ctcount[140]"&gt;
&lt;input type="hidden" value="Apples" name="catname[140]"&gt;

&lt;input type="checkbox" name="chk[142]"&gt;
&lt;input type="hidden" value="20" name="ctcount[142]"&gt;
&lt;input type="hidden" value="Bananas" name="catname[142]"&gt;

&lt;input type="checkbox" name="chk[144]"&gt;
&lt;input type="hidden" value="200" name="ctcount[144]"&gt;
&lt;input type="hidden" value="Strawberries" name="catname[144]"&gt;

&lt;input type="checkbox" name="chk[145]"&gt;
&lt;input type="hidden" value="0" name="ctcount[145]"&gt;
&lt;input type="hidden" value="Carrots" name="catname[145]"&gt;
</code></pre>

<p>When a user clicks a button, I want the Javascript to:</p>

<pre><code> 1. Loop through all the checkboxes
 2. For all the checked checkboxes, 
     2a. Get ctcount value
     2b. Get catname value
     2c. If ctcount value &gt; 50, alert a message saying "Unable to add item
          as max limit for 'catname' has reached.
     2d. Break the loop after it encountered first ctcount value that is 
         greater than 50.
</code></pre>

<p>I am new to JQuery..have the following code so far:         </p>

<p>var checklimit = 50;
$('#frmTest input:checkbox:checked').each(function(i) {
                alert(this.value);
            });</p>

<p>How do I do this using JQuery?</p>

<p>Thanks</p>
