hola amigos pueden ayudarme??
checando este codigo no me funciona solo corre la primera condicion esta (valorauto>=partepago), con el error y todo pero cuando va a la segunda condicion solo hace la opracion y no da el error (valorauto>=cuotainicial), y en caso del otro if no me ejecuta!!!!!
de antemano les agradezco por su ayuda!!!!!!!
Código Javascript
:
Ver original<script> //suma para calcular el saldo
function calculo(F)
{
var valorauto=parseInt(txt_precio_venta.value);
if(F.txt_precio_venta.value==""){
valorauto=1;
}
var partepago=parseInt(F.txt_vehiculo_parte_pago.value);
if(F.txt_vehiculo_parte_pago==""){
partepago=0;
}
var cuotainicial=parseInt(F.txt_cuota_inicial.value);
if(F.txt_cuota_inicial.value==""){
cuotainicial=0;
}
var total=0;
var totalparcial=0;
if ((valorauto>=partepago)||(valorauto>=cuotainicial))
{
//total= valorauto - cuotainicial;
total1= valorauto - partepago;
F.txt_saldo.value=total;
F.txt_saldo.value=total1;
}
else{
alert("LOS DATOS SON MAYOR Q VALOR AUTO INGRESE CORRECTAMENTE EL DATO")
F.txt_cuota_inicial.value="";
F.txt_parte_pago.value="";
}
////calculoparte
if ((valorauto>0)&&(valorauto>0)){
if((valorauto>=cuotainicial)&&(valorauto>=partepago)){
totalparcial=cuotainicial+partepago;
total=valor-total
}
}
else {
alert ("los los dartos son mayor q el saldo")
}
}
</script>