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

The cell code (generated with php) is:
for ($i=0;$i<15;$i++){
echo "<input name='$name1' id='$name1' value='$i'

The javascript is:
<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++){

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?