I have a table with 15 rows containing a number of textboxes. If I change a numerical value in the last box in a row then, from the next row down to the end, the values must start from one more than that value, and increment in each row. Thus, eg, I want this change to occur when I alter the 2 to 5 in the second row:
1 1
2 5
3 6
4 7
etc

The cell code (generated with php) is:
for ($i=0;$i<15;$i++){
........
echo "<input name='$name1' id='$name1' value='$i'
onchange='AdjustTracks($i);alert(\"here\");'>";
........
}

The javascript is:
<head>
<script type="text/javascript">
function AdjustTracks(i){
var box=document.getElementById("workData"+i+"_5");
var endTr=parseInt(box.value);
for (j=i+1;j<15;j++){
endTr=endTr+1;
box=document.getElementById("workData"+j+"_5");
box.value=endTr;
}
return;
}
</script>
</head>

When I change one of the values, the javascript function is called and the other values change correctly. As soon as I release the alert, however, all the boxes return to their original values. What is happening?
Thanks