Ver Mensaje Individual
  #3 (permalink)  
Antiguo 20/11/2007, 16:48
Avatar de Gaby_Corr
Gaby_Corr
 
Fecha de Ingreso: junio-2005
Mensajes: 672
Antigüedad: 19 años, 11 meses
Puntos: 0
Re: 2 funciones ajax se pueden en una misma pagina?

pues bueno nada mas he hecho 1 funcion en ajax para consultar, y casi no he metido mano en esas ondas, jejeje

lo que ahorita intente fue cambiar de nombre las variables para ver si funcionaba, jaja pero pues creo que no, me marca un error y no se como solucionarlo =S

el problema es Myakire que necesito actualizar el valor de un textarea apartir del valor de elemento seleccionado (<option>) de un select

ojala me puedas ayudar con esto, la funcion es la que tengo asi bueno esta es la original y q utilizo para consultar loq ue se tecleo en un input, y ahora esto es lo que quiero poner pero para el select

Código:
function getHTTPObject() {
    var xmlhttp;
    /*@cc_on
    @if (@_jscript_version >= 5)
       try {
          xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
       } catch (e) {
          try {
             xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (E) { xmlhttp = false; }
       }
    @else
    xmlhttp = false;
    @end @*/
    if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
       try {
          xmlhttp = new XMLHttpRequest();
       } catch (e) { xmlhttp = false; }
    }
    return xmlhttp;
}

var enProceso = false; // lo usamos para ver si hay un proceso activo
var http = getHTTPObject(); // Creamos el objeto XMLHttpRequest

function handleHttpResponse() {
    if (http.readyState == 4) {
       if (http.status == 200) {
          if (http.responseText.indexOf('invalid') == -1) {
             results = http.responseText.split("|");			 
			 document.getElementById("distribuidor").value = results[0];
			 document.getElementById("encabezadopet").value = results[1];
             document.getElementById("pantalla").value = results[2];
			 document.getElementById("cliente").value = results[3];			
			 document.getElementById("comentarios").value = results[4];			 
             enProceso = false;			
          }
       }
    }
}

function Buscar(dato) {
    if (!enProceso && http) {
       var val = escape(document.getElementById(dato).value);	  
	   var valor = val.replace(/%20/g,' ');
       var url = "enviarPeticion.asp?datoabuscar="+ valor;
       http.open("GET", url+ "&random=" + Math.random(), true);
	   http.onreadystatechange = handleHttpResponse;
       enProceso = true;      
	   http.send(null);
    }
}
__________________
" Recuerda , estas donde debes estar ..."