Hi,
I have a page that displays (in a table) information to the user reflecting what is IN the database and they may change the data by editing it as shown and then SAVE the data back to the database by clicking on a button.
As each field is updated (via AJAX calls), I would like a little green check mark to display next to the cell in the table. This is where the problem comes in....
If I run the code with an alert message showing me what the SQL is being sent to the database, it runs fine. All the green check marks show up. If I comment out the alert and just let the code run as intended, the only check mark to appear is the very last one -- which I assume is the last bit of code executed.
I've tried slowing down the code with a clever pause function that I found online, but that does not help. I know I'm (being a Newbie) probably missing the big picture here of how things are functioning, but how can I make the check marks show up as the code is executed??
Here is how the check marks are hidden on the page to begin with:
Here is the code that is called upon the return in AJAX that should be showing the checkboxes:
Thanks for your time!
I have a page that displays (in a table) information to the user reflecting what is IN the database and they may change the data by editing it as shown and then SAVE the data back to the database by clicking on a button.
As each field is updated (via AJAX calls), I would like a little green check mark to display next to the cell in the table. This is where the problem comes in....
If I run the code with an alert message showing me what the SQL is being sent to the database, it runs fine. All the green check marks show up. If I comment out the alert and just let the code run as intended, the only check mark to appear is the very last one -- which I assume is the last bit of code executed.
I've tried slowing down the code with a clever pause function that I found online, but that does not help. I know I'm (being a Newbie) probably missing the big picture here of how things are functioning, but how can I make the check marks show up as the code is executed??
Here is how the check marks are hidden on the page to begin with:
Code:
<div align="center"><span id="person" style="display:none"><img src="images/green_tick.png" width="20" height="19"></span></div>
Here is the code that is called upon the return in AJAX that should be showing the checkboxes:
Code:
function stateChanged()
{
if (xmlHttp.readyState==4)
{
if (xmlHttp.status != 200)
{
alert("file not found: " + xmlHttp.status);
return;
}
else
{
var message = xmlHttp.responseText;
if (!message)
{
//alert("invalid AJAX response or file!");
return;
}
else
{
//alert("message is: " + message);
document.getElementById(message).style.display = 'block';
pausecomp(1250);
}
}
}
}
Thanks for your time!