I hope I can explain what I am trying to do so that everyone can understand.
I have a table with 20 rows in it. All of which contain no data at this point. I then want to run a script which will populate the first row with something like "Processing application #1". If my processing succeeds, then I want to replace that row with "Processing application #2" and so forth. The catch is if that the processing should fail, I want to leave it up on the screen with an error and the above process will happen using the second row.
The problem is that I want to do this without having to submit the page over and over again.
Below is an example of what should be seen on the screen.
Processing Application #1 - Error
Processing Application #9 - Error
Processing Application #10 ...
The processing Application #10 line will increment to 11, 12, 13 until an error is reached or we complete everything.
I have coded this several ways putting a sleep loop to make sure that the lines are not scrolling too fast for the user to see and also tried using a setTimeout. But all that happens is I never see any lines "Processing application #?" until I reach the end. Then I see the last one.
If I put any kind of intervention in, like an alert in the middle, I will see each row display. If I don't put in an alert, I will only see the last one.
Is there a way to force the redraw without any intervention?
Here is an example of what I am doing:
<html>
<body>
<form name="application_list">
<table>
<tr>
<td><input type="text" name="app_descr1"></td>
</tr>
</table>
</form>
<script language='javascript'>
function putDescription( ) {
for (var i=1;i=30;i++) {
document.application_list.app_descr1.value = "Processing Application #" + i;
sleep(5000);
}
}
putDescription();
</script>
</body>
</html>
The above example uses another function sleep to pause for 5 seconds. This should give the user ample time to read what is on the screen.
You would think the above example would display the line in the table, pause for 5 seconds, and then display the next one on the same line right? Wrong!
The only thing that shows up is "Processing Application #30".
Can someone help?
I have a table with 20 rows in it. All of which contain no data at this point. I then want to run a script which will populate the first row with something like "Processing application #1". If my processing succeeds, then I want to replace that row with "Processing application #2" and so forth. The catch is if that the processing should fail, I want to leave it up on the screen with an error and the above process will happen using the second row.
The problem is that I want to do this without having to submit the page over and over again.
Below is an example of what should be seen on the screen.
Processing Application #1 - Error
Processing Application #9 - Error
Processing Application #10 ...
The processing Application #10 line will increment to 11, 12, 13 until an error is reached or we complete everything.
I have coded this several ways putting a sleep loop to make sure that the lines are not scrolling too fast for the user to see and also tried using a setTimeout. But all that happens is I never see any lines "Processing application #?" until I reach the end. Then I see the last one.
If I put any kind of intervention in, like an alert in the middle, I will see each row display. If I don't put in an alert, I will only see the last one.
Is there a way to force the redraw without any intervention?
Here is an example of what I am doing:
<html>
<body>
<form name="application_list">
<table>
<tr>
<td><input type="text" name="app_descr1"></td>
</tr>
</table>
</form>
<script language='javascript'>
function putDescription( ) {
for (var i=1;i=30;i++) {
document.application_list.app_descr1.value = "Processing Application #" + i;
sleep(5000);
}
}
putDescription();
</script>
</body>
</html>
The above example uses another function sleep to pause for 5 seconds. This should give the user ample time to read what is on the screen.
You would think the above example would display the line in the table, pause for 5 seconds, and then display the next one on the same line right? Wrong!
The only thing that shows up is "Processing Application #30".
Can someone help?