I have two sets of of input fields like this, differentiated by their classes:
<div>
<input type="text" class="columnone" />
<input type="text" class="columnone" />
<input type="text" class="columnone" />
</div>
<div>
<input type="text" class="columntwo" />
<input type="text" class="columntwo" />
<input type="text" class="columntwo" />
</div>
Necessary validations are in place to ensure that only integer values can be input by the user into these fields.
How do I subtract the value of each input field in .columntwo from the value in the corresponding field in .columnone on change() in that particular .columntwo text field? Null values should be considered zero.
For example, on change() in the first input field in columntwo, subtract the value of the first input field in .columntwo from the first field in .columntwo. Other fields remain unchanged.
Thanks in advance!
columnoneandcolumntwoto the wrapping div,s instead of to each input element?