Si señor, yo pense que estaba trabajando con indices pero es que tenia mal los nombres, el codigo para que funcione correctamente es:
Código HTML:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> Documento sin título
function fncSumar(){
caja = document.forms["frm"].elements;
var numero1 = Number(caja['cantidad'].value);
var numero2 = Number(caja['pvp'].value);
total = numero1*numero2;
if(!isNaN(total)) {
caja['total'].value = numero1*numero2;
}
}
<form method="post" name="frm" id="frm"> <td class="enlace10"></td> <td class="enlace10"></td> <td class="enlace10">Almacén
</td> <td class="enlace10">Referencia
</td> <td class="enlace10">Descripción
</td> <td class="enlace10">Cantidad
</td> <td class="enlace10">Precio
</td> <td class="enlace10">%Dto.
</td> <td class="enlace10">Total
</td> <td class="enlace10"></td> <input name="button" type=button onclick="agregar();" value="+" /> <input name="button" type=button onclick="borrarUltima();" value="-"/> <input name="almacen" type="text" size="5" /> <input name="recambio" id="recambio" type="text" size="10"/> <input name="denominacion" type="text" size="25"/> <input name="cantidad"type="text" size="5" onkeydown="fncSumar();" onkeyup="fncSumar();"/> <input name="pvp" type="text" size="5" onkeydown="fncSumar();" onkeyup="fncSumar();"/> <input name="descuento" type="text" size="5" /> <input name="total" type="text" size="5" /> <img src="imagenes_menu/untitled.png" width="20" height="20" style="cursor:pointer" />