I have two sets of input fields like this that differ in 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>
Checks are needed to ensure that only integer values can be entered in these fields.
How to subtract the value of each input field in .columntwofrom the value in the corresponding field in .columnoneon change()in this text box .columntwo? Zero values should be considered zero.
For example, in change()the first input field in, columntwosubtract the value of the first input field in .columntwofrom the first field in .columntwo. Other fields remain unchanged.
Thanks in advance!
source
share