creo que si... mira....
Código Javascript
:
Ver originalfunction save() {
ajax=objetoAjax();
ajax.onreadystatechange=function() {
if (ajax.readyState==4 && ajax.status==200) {
alert("circuit save succefully");
listar();
}
}
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='';
}
}
function listar(){
var ajax2 = objetoAjax();
ajax.onreadystatechange=function() {
if (ajax2.readyState==4 && ajax2.status==200) {
}
}
ajax2.open("POST","circuit_actual.php",true);
ajax2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
ajax2.send("id=4&other=4");//aqui puedes poner tus parametros
}
y este es mi listar en php
Código PHP:
Ver original<?php
include "config.php";
$nombrecir=$_SESSION['namecirc'];
$query = "SELECT city FROM `sites` WHERE nombreCirc='".$nombrecir."'";
$numero = 0;
{
echo "<td width=\"25%\"><font face=\"verdana\">" .
$row["city"] . "</font></td>";
echo "<td width=\"25%\"><font face=\"verdana\">" .
$row["arrival"] . "</font></td>";
echo "<td width=\"25%\"><font face=\"verdana\">" .
$row["departure"] . "</font></td>";
echo "<td width=\"25%\"><font face=\"verdana\">" .
$row["comment"]. "</font></td>";
$numero++;
}
echo "<tr><td colspan=\"15\"><font face=\"verdana\"><b>Número: " . $numero .
"</b></font></td></tr>";
?>