Ver Mensaje Individual
  #7 (permalink)  
Antiguo 10/10/2012, 11:27
Avatar de maximendez88
maximendez88
 
Fecha de Ingreso: septiembre-2012
Ubicación: Montevideo
Mensajes: 131
Antigüedad: 11 años, 7 meses
Puntos: 3
Pregunta Respuesta: mostrar un listado php con ajax

si entiendo bien... el tema es que estoy intentando hacerlo y no logro dar con el clavo.... este es mi codigo....



Código HTML:
	
	
   function save() {
      
       
    

	   

	
	
 ajax=objetoAjax();



 ajax.onreadystatechange=function() {
  if (ajax.readyState==4) {
 

alert("se introdujo con exito en la base de datos");


 if(ajax.status==200) 
            { 
			
			
            ajaxlistar=otroObjetoAjax();
			
			
			  ajax.open("POST","circuit_actual.php",true);
  
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			
            
			
			}  

 
 
 
  }
 }
 
 
 
 var cityvalue=encodeURIComponent(document.getElementById('city').value)
var arrivalvalue=encodeURIComponent(document.getElementById('datepicker_value').value)
var departurevalue=encodeURIComponent(document.getElementById('otrodatepicker_value').value)
var commentvalue=encodeURIComponent(document.getElementById('comment').value)


 
if(arrivalvalue>departurevalue)
{
	alert('Day of arrival can not be after a day of departure');
}


else if(departurevalue<arrivalvalue)
{
	alert('Day of departure can not be until the arrival day');
}

else{
 
  ajax.open("GET", "addCity.php?city="+cityvalue+"&arrival="+arrivalvalue+"&departure="+departurevalue+"&comment="+commentvalue,true);
  
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	
	
//enviando los valores
 ajax.send()
	
	 document.getElementById('savecity').disabled = true;
	    document.getElementById('more').disabled = true; 
	   document.getElementById('ciudad').value = "Select other city";
	   document.getElementById('add').disabled = false;
	   
	   document.getElementById('inner').style.display="block";
	 
	document.getElementById('datepicker_value').value='';
		 document.getElementById('otrodatepicker_value').value='';
		 document.getElementById('comment').value='';


}




 
}