issue in disabling submit button using jquery
<p>i am iterating a list , and displaying its values in  textboxes. 
there is  two textboxes with name <code>checkquantity</code> &amp; <code>quantity</code> whose values i am iterating from a list.</p>

<p>Now users have to enter the quantity values, if they enter the quantity values more then the allocated quantity. Then i  have to disable the submit button.</p>

<p><em>This is my problem:</em>
From my below code , submit button is diasabling for first time only. i.e. if i enter invalid values  for first time then my code is working fine but if again i enter valid values in another text-box  then my button is enabling. But it should not enable since in first textbox invalid values are entered. </p>

<p><strong>Note:</strong> Users can only enter values in textbox name <code>quantity</code> and this textbox will be validated from the textbox <code>checkquantity</code>.</p>

<p>Please check my below code and suggest me a solution for this.</p>

<pre><code>$('input[name="quantity"]').keyup(function() {
    var $tr = $(this).closest("tr");
    var q = +$tr.find('input[name^="quantity"]').val();
    var cq = +$tr.find('input[name^="checkquantity"]').val();

    if (q &gt; cq) {
        $('#submtbtnId').attr('disabled', 'disabled');
    }
    else {
        $('#submtbtnId').removeAttr('disabled');
    }
});
----------------------------------- in
while loop my list is iterating 
{ 
  &lt;tr&gt; 
    &lt;td width = "10%"&gt; 
      &lt;input type = "text" name = "quantity"values = "" id = "quantity" / &gt;   
      &lt;input type = "text" name = "checkquantity" disable = "disable"
          values = "random values coming from my list   
                 eg. 5 or 9 ..." / &gt; &lt; /td&gt;   
  &lt;/tr &gt;
}

------------------------- 
 &lt; input type = "submit" id = "submtbtnId" / &gt;​
</code></pre>
