
06/02/2013, 17:33
|
| | Fecha de Ingreso: septiembre-2012 Ubicación: posadas
Mensajes: 53
Antigüedad: 12 años, 5 meses Puntos: 0 | |
Respuesta: valor NaN devuelto por js lo tengo asi como me pasaste
<script type="text/javascript">
//<![CDATA[
function calcula(){
var cantidad = document.getElementById('CANTIDAD').value;
var cant = parseFloat(cantidad);
var precio = document.getElementById('PRECIO').innerHTML;
var prec = parseFloat(precio);
var subtotal = cant * prec;
var stotal = parseFloat(subtotal);//por las dudas
document.getElementById('SUBTOTAL').value = stotal
}
//]]>
</script>
devuelve NaN el subtotal.... me pasa el valor en el div se muestra x ej 5.99 si lo pongo fijo anda sino da NaN. gracias |