I'm trying to make an invoice that adds me the input in real time, and basically "I have it", but what I need is that it is not "mandatory" to fill an input to show me the results, which as that is adding values are shown, not at the end when they are all full.
I leave the Js function that I have so far, I hope you can help me
function cal() {
try {
var a = parseInt(document.frmFactura.Cuota.value),
b = parseInt(document.frmFactura.Saldo.value),
c = parseInt(document.frmFactura.Areas.value),
d = parseInt(document.frmFactura.CuotaExtra.value);
document.frmFactura.nuevoSaldo.value = a + b + c + d ;
} catch (e) {
}
}
this is the html file
<input type="text" class="form-control" id="Cuota" name="Cuota" value="95000" onchange="cal()" onkeypress="cal()" >
<input type="text" class="form-control" id="Saldo" name="Saldo" onchange="cal()" onkeypress="cal()" >
<input type="text" class="form-control" id="Areas" name="Areas" placeholder="Vehiculo, Moto, Salon Comunal" onchange="cal()" onkeypress="cal()" >
<input type="text" class="form-control" id="CuotaExtra" name="CuotaExtra" onchange="cal()">