Sum and Multiply dynamic input

0

Ihavethisfunctionthatmultipliesqnt*vlor=subtotalinaPivotTable.

Butitonlycalculatesonthefirstline.Iwouldalsoliketopullthesumsumtotalsubtotal.

Ifound this link but wanted something simpler.

Sum

<script type="text/javascript">
$("#tbodyCotacao").on("blur keyup", function (event) {
      calcular()
});

function calcular(){
    var valor1 = parseInt(document.getElementById('pqnt').value, 10);
    var valor2 = parseInt(document.getElementById('pvlr').value, 10);
    document.getElementById('ptotal').value = valor1 * valor2;
}
</script>
    
asked by anonymous 09.11.2018 / 18:11

0 answers