There is a table
SUM | <input type="text"> | <input type="text"> |
| <input type="text"> | <input type="text"> |
| <input type="text"> | <input type="text"> |
SUM | <input type="text"> | <input type="text"> |
| <input type="text"> | <input type="text"> |
FOO | <input type="text"> | <input type="text"> |
BAR | <input type="text"> | <input type="text"> |
I want to get sum of columns below "SUM row" when input value is changed. If there is other column ex FOO BAR it shouldn't be count to sum.
What is aproach here? Dummy idea: every column has reference where it value will be summed.
Fiddle for quick start: http://jsfiddle.net/igos/vNxzu/
EDIT It should sum up till next sum row right.
row 0 col 0 = row 1 col 0 + row 2 col 0
row 0 col 1 = row 1 col 1 + row 2 col 1
row 3 col 0 = row 4 col 0
row 3 col 1 = row 4 col 1
It should be dynamic, so when more rows come it will automatically add more rows.
class="sumCell") and just use jQuery to select those cells and sum the value when a value changes?