0

I would like to create an array for auto calculation for multiple input field. The problem is, the auto calculation works like charm for the 1st row, but not for 2nd and 3rd row. I would like to have 15 row.

Any help would be appreciated.

<html>
<head>
<script type="text/javascript">
function calc(){
var textValue10 = document.getElementById('input10').value;
var textValue9 = document.getElementById('input9').value;
var textValue8 = document.getElementById('input8').value;
var textValue7 = document.getElementById('input7').value;
var textValue6 = document.getElementById('input6').value;
var textValue5 = document.getElementById('input5').value;
var textValue4 = document.getElementById('input4').value;
var textValue3 = document.getElementById('input3').value;
var textValue2 = document.getElementById('input2').value;
var textValue1 = document.getElementById('input1').value;
document.getElementById('output').value = (textValue10*10) + (textValue9*9) + (textValue8*8) + (textValue7*7) + (textValue6*6) + (textValue5*5) + (textValue4*4) + (textValue3*3) + (textValue2*2) + (textValue1*1); 
 }
</script>
</head>

<body>
10&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 	&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    9&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    8&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    7&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    6&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    5&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    4&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    3&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    2&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    1&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp	TOTAL<br>
<input type="text" name="input10" id="input10" size="8" onkeyup="calc()"value="">
<input type="text" name="input9" id="input9" size="8" onkeyup="calc()" value="">
<input type="text" name="input8" id="input8" size="8" onkeyup="calc()"value="">
<input type="text" name="input7" id="input7" size="8" onkeyup="calc()" value="">
<input type="text" name="input6" id="input6" size="8" onkeyup="calc()"value="">
<input type="text" name="input5" id="input5" size="8" onkeyup="calc()" value="">
<input type="text" name="input4" id="input4" size="8" onkeyup="calc()"value="">
<input type="text" name="input3" id="input3" size="8" onkeyup="calc()" value="">
<input type="text" name="input2" id="input2" size="8" onkeyup="calc()"value="">
<input type="text" name="input1" id="input1" size="8" onkeyup="calc()" value="">
<input type="text" name="output" id="output" size="16" onkeyup="calc()" value="">
<br>
10&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 	&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    9&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    8&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    7&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    6&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    5&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    4&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    3&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    2&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    1&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp	TOTAL<br>
<input type="text" name="input10" id="input10" size="8" onkeyup="calc()"value="">
<input type="text" name="input9" id="input9" size="8" onkeyup="calc()" value="">
<input type="text" name="input8" id="input8" size="8" onkeyup="calc()"value="">
<input type="text" name="input7" id="input7" size="8" onkeyup="calc()" value="">
<input type="text" name="input6" id="input6" size="8" onkeyup="calc()"value="">
<input type="text" name="input5" id="input5" size="8" onkeyup="calc()" value="">
<input type="text" name="input4" id="input4" size="8" onkeyup="calc()"value="">
<input type="text" name="input3" id="input3" size="8" onkeyup="calc()" value="">
<input type="text" name="input2" id="input2" size="8" onkeyup="calc()"value="">
<input type="text" name="input1" id="input1" size="8" onkeyup="calc()" value="">
<input type="text" name="output" id="output" size="16" onkeyup="calc()" value="">
<br>
10&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 	&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    9&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    8&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    7&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    6&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    5&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    4&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    3&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    2&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp    1&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp	TOTAL<br>
<input type="text" name="input10" id="input10" size="8" onkeyup="calc()"value="">
<input type="text" name="input9" id="input9" size="8" onkeyup="calc()" value="">
<input type="text" name="input8" id="input8" size="8" onkeyup="calc()"value="">
<input type="text" name="input7" id="input7" size="8" onkeyup="calc()" value="">
<input type="text" name="input6" id="input6" size="8" onkeyup="calc()"value="">
<input type="text" name="input5" id="input5" size="8" onkeyup="calc()" value="">
<input type="text" name="input4" id="input4" size="8" onkeyup="calc()"value="">
<input type="text" name="input3" id="input3" size="8" onkeyup="calc()" value="">
<input type="text" name="input2" id="input2" size="8" onkeyup="calc()"value="">
<input type="text" name="input1" id="input1" size="8" onkeyup="calc()" value="">
<input type="text" name="output" id="output" size="16" onkeyup="calc()" value="">

</body>
</html>

5
  • you have same ids for 3 rows Commented Apr 1, 2018 at 8:35
  • Can you explain what do you mean by rows? Commented Apr 1, 2018 at 8:35
  • this is a calculation for shooting game. Each input value will be time 10,9,8,7,6,5,4,3,2,1. example : if value for box 10 is 2.total will be 20. Commented Apr 1, 2018 at 8:47
  • 1
    Every id attribute must be unique on the entire page. You may want to use class attributes instead with the querySelector. Commented Apr 1, 2018 at 9:31
  • Possible duplicate of Javascript - Create array with inputs values Commented Apr 1, 2018 at 13:19

2 Answers 2

0

The issue is simple, there can only be one unique id for a HTML element. you have given the same ID for multiple elements.

Javascript getElementById method will only pick the very first element with the given id and ignore the rest of them.

That is the reason your first row working like a charm and rest are ignored.

Try different ids for each element. Or use getElementsByClassName method while assign a unique class for each row.

<html>

<head>
    <script type="text/javascript">
        function calc() {
            var row1 = document.getElementsByClassName('row1');
            var row2 = document.getElementsByClassName('row2');
            var row3 = document.getElementsByClassName('row3');
            document.getElementById('output1').value= clacARow(row1);
            document.getElementById('output2').value = clacARow(row2);
            document.getElementById('output3').value = clacARow(row3);
        
            
        }

        function clacARow(row){
            var output = 0;

            for(var i=0; i<row.length;i++){
                var value = (row[i].value)*(row.length-i);
                console.log(i)
                if(value){
                    output = output + value;
                }
            }
            console.log(output);
            return output;
        }
    </script>
</head>

<body>
    10&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    9&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    8&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 7&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    6&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 5&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    4&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 3&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    2&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 1&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    TOTAL
    <br>
    <input type="text" class="row1" name="input10" id="input10" size="8" onkeyup="calc()" value="">
    <input type="text" class="row1" name="input9" id="input9" size="8" onkeyup="calc()" value="">
    <input type="text" class="row1" name="input8" id="input8" size="8" onkeyup="calc()" value="">
    <input type="text" class="row1" name="input7" id="input7" size="8" onkeyup="calc()" value="">
    <input type="text" class="row1" name="input6" id="input6" size="8" onkeyup="calc()" value="">
    <input type="text" class="row1" name="input5" id="input5" size="8" onkeyup="calc()" value="">
    <input type="text" class="row1" name="input4" id="input4" size="8" onkeyup="calc()" value="">
    <input type="text" class="row1" name="input3" id="input3" size="8" onkeyup="calc()" value="">
    <input type="text" class="row1" name="input2" id="input2" size="8" onkeyup="calc()" value="">
    <input type="text" class="row1" name="input1" id="input1" size="8"  onkeyup="calc()" value="">
    <input type="text" name="output" id="output1" size="16" onkeyup="calc()" disabled="disabled" value="">
    <br> 10&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    9&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    8&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 7&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    6&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 5&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    4&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 3&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    2&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 1&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    TOTAL
    <br>
    <input type="text" class="row2" name="input10" id="input10" size="8" onkeyup="calc()" value="">
    <input type="text" class="row2" name="input9" id="input9" size="8" onkeyup="calc()" value="">
    <input type="text" class="row2" name="input8" id="input8" size="8" onkeyup="calc()" value="">
    <input type="text" class="row2" name="input7" id="input7" size="8" onkeyup="calc()" value="">
    <input type="text" class="row2" name="input6" id="input6" size="8" onkeyup="calc()" value="">
    <input type="text" class="row2" name="input5" id="input5" size="8" onkeyup="calc()" value="">
    <input type="text" class="row2" name="input4" id="input4" size="8" onkeyup="calc()" value="">
    <input type="text" class="row2" name="input3" id="input3" size="8" onkeyup="calc()" value="">
    <input type="text" class="row2" name="input2" id="input2" size="8" onkeyup="calc()" value="">
    <input type="text" class="row2" name="input1" id="input1" size="8" onkeyup="calc()" value="">
    <input type="text" name="output" id="output2" size="16" disabled="disabled" onkeyup="calc()" value="">
    <br> 10&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    9&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    8&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 7&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    6&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 5&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    4&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 3&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    2&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 1&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    TOTAL
    <br>
    <input type="text" class="row3" name="input10" id="input10" size="8" onkeyup="calc()" value="">
    <input type="text" class="row3" name="input9" id="input9" size="8" onkeyup="calc()" value="">
    <input type="text" class="row3" name="input8" id="input8" size="8" onkeyup="calc()" value="">
    <input type="text" class="row3" name="input7" id="input7" size="8" onkeyup="calc()" value="">
    <input type="text" class="row3" name="input6" id="input6" size="8" onkeyup="calc()" value="">
    <input type="text" class="row3" name="input5" id="input5" size="8" onkeyup="calc()" value="">
    <input type="text" class="row3" name="input4" id="input4" size="8" onkeyup="calc()" value="">
    <input type="text" class="row3" name="input3" id="input3" size="8" onkeyup="calc()" value="">
    <input type="text" class="row3" name="input2" id="input2" size="8" onkeyup="calc()" value="">
    <input type="text" class="row3" name="input1" id="input1" size="8" onkeyup="calc()" value="">
    <input type="text"  name="output" id="output3" size="16" disabled="disabled" onkeyup="calc()" value="">

</body>

</html>

Sign up to request clarification or add additional context in comments.

3 Comments

tq sir for the explanation. so,do i need to duplicate the javascript for 15 time for my 15 row with the different id?
A working code is added to my answer you can refer that. If you like the output please upvote.
Tq sir. tq for thr tremendous answer. tq again sir.
0

You can use querySelectorAll of DOM to get the calculation done dynamically.

function calc(rowNumber){
var cells = document.querySelectorAll("#table tr:nth-child("+(rowNumber+2)+") td");

var sum = 0;
for (var i = 0; i < cells.length; i++) {
   var val = parseFloat(cells[i].firstChild.value) * (10 - i);
   if (!isNaN(val)) {
      sum+=val;
   }
}
cells[10].firstChild.value = sum;
 }
<table id="table">
  <tr>
  <td>10</td>
  <td>9</td>
  <td>8</td>
  <td>7</td>
  <td>6</td>
  <td>5</td>
  <td>4</td>
  <td>3</td>
  <td>2</td>
  <td>1</td>
  <td>Total</td>
  </tr>
  
  <tr>
  <td><input size="8" onkeyup="calc(0)"value=""></td>
  <td><input size="8" onkeyup="calc(0)"value=""></td>
  <td><input size="8" onkeyup="calc(0)"value=""></td>
  <td><input size="8" onkeyup="calc(0)"value=""></td>
  <td><input size="8" onkeyup="calc(0)"value=""></td>
  <td><input size="8" onkeyup="calc(0)"value=""></td>
  <td><input size="8" onkeyup="calc(0)"value=""></td>
  <td><input size="8" onkeyup="calc(0)"value=""></td>
  <td><input size="8" onkeyup="calc(0)"value=""></td>
  <td><input size="8" onkeyup="calc(0)"value=""></td>
  <td><input size="8" value="" id="total"></td>
  </tr>
  <tr>
  <td><input size="8" onkeyup="calc(1)"value=""></td>
  <td><input size="8" onkeyup="calc(1)"value=""></td>
  <td><input size="8" onkeyup="calc(1)"value=""></td>
  <td><input size="8" onkeyup="calc(1)"value=""></td>
  <td><input size="8" onkeyup="calc(1)"value=""></td>
  <td><input size="8" onkeyup="calc(1)"value=""></td>
  <td><input size="8" onkeyup="calc(1)"value=""></td>
  <td><input size="8" onkeyup="calc(1)"value=""></td>
  <td><input size="8" onkeyup="calc(1)"value=""></td>
  <td><input size="8" onkeyup="calc(1)"value=""></td>
  <td><input size="8" value="" id="total"></td>
  </tr>
</table>

1 Comment

Tq bos. this answer help me too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.