Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery: sum input text fields
    primarykey
    data
    text
    <p>I have a table including input text fields with the basic structure below. I am having trouble building a function to iterate all rows in the table and sum all the values of input fields beginning with BFObel where the value of the field beginning with BFOkto are the same. So for the basic example below the sum for value 1111 would be 2000 and the sum for value 1112 would be 3000. Each sum would then be written to an inputfield with the id field1111, field1112 etc...</p> <pre><code>&lt;table&gt; &lt;tr id="BFOrow1"&gt; &lt;td&gt;&lt;input type="text" id="BFOtxt1" value="text"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="BFOkto1" value="1111" /&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="BFObel1" value="1000" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr id="BFOrow2"&gt; &lt;td&gt;&lt;input type="text" id="BFOtxt2" value="text"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="BFOkto2" value="1111" /&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="BFObel2" value="1000" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr id="BFOrow3"&gt; &lt;td&gt;&lt;input type="text" id="BFOtxt3" value="text"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="BFOkto3" value="1112" /&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="BFObel3" value="1000" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr id="BFOrow4"&gt; &lt;td&gt;&lt;input type="text" id="BFOtxt4" value="text"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="BFOkto4" value="1112" /&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="BFObel4" value="1000" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr id="BFOrow5"&gt; &lt;td&gt;&lt;input type="text" id="BFOtxt5" value="text"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="BFOkto5" value="1112" /&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="BFObel5" value="1000" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload