Tengo el siguiente codigo y querria saber en que falla. la suma de productos la hace bien aunque querría que solo tenga dos decimales, y la suma total no va...
Alguien sabe que puede fallar????
<html>
<head>
<title>hoja de pedido</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<SCRIPT LANGUAGE=javascript>
<!--
function sumar(){
formu.total.value=(parseInt(formu.total12am.value) +parseInt(formu.total12ol.value)
+parseInt(formu.total12ro.value)
);
return;
}
function subprecio12a(){
formu.total12am.value=formu.canpm12am.value*2.10;
formu.totalmoscas.value=parseInt(formu.totalmoscas .value)+parseInt(formu.canpm12am.value);
return;
}
function subprecio12b(){
formu.total12ol.value=formu.canpm12ol.value*2.15;
formu.totalmoscas.value=parseInt(formu.totalmoscas .value)+parseInt(formu.canpm12ol.value);
return;
}
function subprecio12c(){
formu.total12ro.value=formu.canpm12ro.value*2.10;
formu.totalmoscas.value=parseInt(formu.totalmoscas .value)+parseInt(formu.canpm12ro.value);
return;
}
//-->
</SCRIPT>
<body>
<FORM method="post" action="ssss" id=formu name=formu>
<table width="521" border="1" cellpadding="0" cellspacing="1" bordercolor="#333333">
<tr>
<td>PM12AM</td>
<td width="33%">
<input name="canpm12am" value="0" size="5" maxlength="4" onblur="subprecio12a(),sumar()">x 2.10 Euros
</td>
<td width="40%">
<input name="total12am" size="10" value="0" readonly>Euros</div>
</td>
</tr>
<tr>
<td height="30">PM12OL</td>
<td width="33%">
<input name="canpm12ol" size="5" maxlength="4" onblur="subprecio12b(),sumar()" value="0" >x 2.15 Euros
</td>
<td width="40%">
<input name="total12ol" size="10" value="0" readonly>Euros
</td>
</tr>
<tr>
<td>PM12RO</td>
<td width="33%">
<input name="canpm12ro" size="5" maxlength="4" onblur="subprecio12c(),sumar()" value="0">x 2.10 Euros
</td>
<td width="40%">
<input name="total12ro" size="10" value="0" readonly>Euros
</td>
</tr>
<tr>
<td colspan="2">Número de productos:<input name="totalmoscas" size="5" value="0" readonly>
</td>
<td>Total:<input name="total" size="10" readonly value ="0">Euros
</td>
</tr>
<tr>
<td height="30" colspan="3">
<input name="enviar" type="submit" class="boton" value="Enviar Hoja de pedido">
<input name="enviar2" type="reset" class="boton" value="borrar datos">
</td>
</tr>
</table>
</FORM>
</body>
</html>