Ver Mensaje Individual
  #9 (permalink)  
Antiguo 26/06/2009, 07:52
planvirtual
 
Fecha de Ingreso: mayo-2009
Mensajes: 6
Antigüedad: 15 años, 9 meses
Puntos: 0
Respuesta: 2 funciones en un mismo evento. Se puede?

Cita:
Iniciado por David Ver Mensaje
Muéstranos ambas funciones; de lo contrario será difícil que podamos ver el error.
function detalle_pro(art){
if (!art) { return(false); }
var aleatorio=Math.random();
divResultado = document.getElementById('precio') ;
ajax=objetoAjax();
ajax.open("GET", "gestion/_ajax/mysql.php?opcion=precios&aleatorio="+aleatorio+"&a rticulo="+art);
ajax.onreadystatechange=function() {
if (ajax.readyState==4) {
divResultado.value = ajax.responseText ;
document.getElementById('total_0').value = ajax.responseText ;
}
}
ajax.send(null)
}


function calculo()
{
var Error3 = "Error";
var campo = document.getElementById('cantidad') ;
if( campo.value.length < 0 ) {
alert(Error3);
campo.nombre.focus();
return false;
}
total = campo.value * document.getElementById('precio').value ;
descu = total * (document.getElementById('descuento_0').value / 100) ;
subt = total - descu ;
impuestos = (document.getElementById('imp_01').value * 1 + document.getElementById('imp_02').value * 1) / 100 ;
document.getElementById('total_0').value = parseInt( subt * ( 1 + impuestos ));
}