ive got a table with 8x10 cells.. each sell got an input element with its own id (11, 12, ... , 21,22,23,...) now i want to fill these inputs after and after (lets say 0.5 sec)
k
and i
are read after the for
loop ended (1 second to be precise). Their values are then 9 and 11, leading to an array overflow problem.
One option to fix it, is to create a function that does the work, and create a fixed string from the k
and i
variables to call it:
function schreiben(__i, __k) {
document.getElementById(''+__i+__k+'').value= Betrag[__i][__k];
}
Then call the setTimeout
like this:
setTimeout("schreiben("+i+","+k+")", 1000);
Not the most elegant way, but it works.