Jquery .each not working, bad code or a better method available?
<p>First the setup:
jquery 1.5.1
Firefox 4.0</p>

<p>Goal:
I've got a bunch of textboxes that are enabled/disabled using checkboxes.  If a textbox is enabled, I want it to have a value greater than zero.</p>

<p>HTML for one of the boxes(there are a variable number of them on the page):</p>

<pre><code>&lt;input type="text" value="0" name="RequestList[4].iCount" id="RequestList_4__iCount" class="num-box"&gt;
</code></pre>

<p>My jQuery using .each that doesn't work:</p>

<pre><code>var oneFill = false;
$('.num-box').each(function() {
    var myItem = $(this);
    if (myItem.attr('disabled') == false) {
        if (myItem.val() &gt; 0) {
            oneFill = true;
        }
    }
});
if (!oneFill) {
</code></pre>

<p>When I trace the above code in Firebug, it doesn't do anything.  It continues to the next line of code(if(!oneFill)).</p>

<p>When I use $('.num-box') in Firebug, it returns a complete list of all textboxes.  So I'm very confident that I've got the right selector.</p>

<p>So the question is, what did I do wrong?  I've looked at a host of examples here and it appears my use of .each was correct.</p>

<p>But, is there a more efficient method for checking all enabled textboxes with class of num-box?</p>

<p><strong>Addition1</strong>
@artlung
Using continuing my sample html above, I would have at least the following:</p>

<pre><code>&lt;input type="text" value="0" name="RequestList[1].iCount" id="RequestList_1__iCount" class="num-box"&gt;
&lt;input type="text" value="0" name="RequestList[2].iCount" id="RequestList_2__iCount" class="num-box"&gt;
&lt;input type="text" value="0" name="RequestList[3].iCount" id="RequestList_3__iCount" class="num-box"&gt;
&lt;input type="text" value="0" name="RequestList[4].iCount" id="RequestList_4__iCount" class="num-box"&gt;
</code></pre>

<p>The checkboxes would look like:</p>

<pre><code>&lt;input type="checkbox" value="true" name="RDEquipListItem[1]" id="RDEquipListItem_1_"&gt;
&lt;input type="checkbox" value="true" name="RDEquipListItem[2]" id="RDEquipListItem_2_"&gt;
&lt;input type="checkbox" value="true" name="RDEquipListItem[3]" id="RDEquipListItem_3_"&gt;
&lt;input type="checkbox" value="true" name="RDEquipListItem[4]" id="RDEquipListItem_4_"&gt;
</code></pre>

<p>I've got java script that enables/disables the textboxes when the appropriate checkbox is checked.</p>

<p>So far, I've seen some good adjustments to the meat of my code.  I will vote for those tomorrow.</p>

<p>My confusion is whether there is an issue with my .each portion:</p>

<pre><code>$('.num-box').each(function() {
</code></pre>

<p><strong>Addition2</strong>
I've been playing with some of the results.  My current code looks like:</p>

<pre><code>var oneFill = false;
var myEnabled = $('.num-box:enabled');
myEnabled.each(function() {
    var myItem = $(this);
    if (parseInt(myItem.val()) &gt; 0) {
        oneFill = true;
    }
});
if (!oneFill) {
</code></pre>

<p>myEnabled gets the correct list of elements that are enabled.  <em>thumbs up</em></p>

<p>However, the myEnabled.each does nothing.</p>

<p>Is there an issue with a single item being used by .each?</p>

<p><strong>Final comment</strong>
Not sure why this was giving me an issue but I had to reorder the logic a bit.  Even using Firebug, it wouldn't step into the ".each" code but the results are correct.</p>

<p>Final code(NOTE: .num-box are textboxes that are enabled/disabled by checkboxes):</p>

<pre><code>//make sure one item has been filled in and all are greater than zero
var allFilled = true;
var myEnabled = $('.num-box:enabled');
//check that we have at least one item checked out
if (myEnabled.length == 0) {
    alert("At least one needs to be filled.");
    return false;
}

$.each(myEnabled, function() {
    var myItem = $(this);
    if (parseInt(myItem.val()) &lt;= 0) {
        allFilled = false;
    }
});
if (!allFilled)
{
    //go do something
</code></pre>
