Ver Mensaje Individual
  #7 (permalink)  
Antiguo 28/09/2012, 12:24
Avatar de maximendez88
maximendez88
 
Fecha de Ingreso: septiembre-2012
Ubicación: Montevideo
Mensajes: 131
Antigüedad: 11 años, 7 meses
Puntos: 3
Respuesta: cargar en la base de datos sin recargar con ajax

aaa y dejo la function save() que es donde tengo el ajax... puedo insertar en la base de datos... pero me quedan campos vacios!


Código HTML:

function createAjax(){
   if (window.XMLHttpRequest)
   {
      xmlhttp=new XMLHttpRequest();
   }
   else
   {
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
}

    function save() {
      
       document.getElementById('savecity').disabled = true;
       document.getElementById('more').disabled = true; 
	   document.getElementById('ciudad').value = "Select other city";
	   document.getElementById('add').disabled = false;
	   
	createAjax();
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            if(xmlhttp.responseText == "OK")alert('REGISTRO ACTUALIZADO');
        }
    }
	
    xmlhttp.open("GET","addCity.php",true);
    xmlhttp.send("ID=4");
	   
	   
	   
	   
    }
   

Última edición por maximendez88; 28/09/2012 a las 13:40