How do I Select all text boxes in a table excluding the last one in the table row with JQuery
<p>I want add a key up event to every text box element in a table excluding the last text box in each row. The table is dynamic on both axis.</p>

<p>The key up event will total the values in all but the last text box. The total is then placed in the last text box for the row. </p>

<p>The script for the totaling and setting the total all works fine. </p>

<p>I tired the following to select the target elements:</p>

<pre><code>$("#Grid tr input:text:not(:last)").keyup(function(){
    //do total stuff here
})
</code></pre>

<p>Unfortunately it works as documented and not as I wanted and selects all but the very last checkbox.</p>

<p>Ideally the solution will not involve any further markup to the table example below or involve any looping. However if that is what it takes, so be it. </p>

<pre><code>&lt;table id="Grid"&gt;
 &lt;tr id="r1"&gt;
  &lt;td&gt;Row 1&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="txt_a1_b1"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="txt_a1_b2"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="txt_a1_b3"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="txt_a1_b4"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="total_a1"&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr id="r2"&gt;
  &lt;td&gt;Row 2&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="txt_a2_b1"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="txt_a2_b2"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="txt_a2_b3"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="txt_a2_b4"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="total_a2"&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr id="r3"&gt;
  &lt;td&gt;Row 3&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="txt_a3_b1"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="txt_a3_b2"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="txt_a3_b3"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="txt_a3_b4"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="total_a3"&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>One final point, the total text box does need to be a text box as there is also a requirement to enter a total then split it across  the row and I do not want a key up function in the total text box.</p>
