justo estaba en eso! cuando me respondiste!
le agregue unas lineas mas... pero sigue sin funcionar
Código Javascript
:
Ver originalfunction 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");
document.getElementById(capa).innerHTML =ajax.responseText;
}
}
}
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='';
}
}