When you put var changed = true inside onChange(), you are actually defining an inner variable, not global. Therefore when you need to use it in other functions, it implies a new variable with default value to false.
See my suggestion by moving the declaration of changed variable into global scope.
Cheers,
Tien
Main Topics
Browse All Topics





by: ZylochPosted on 2009-07-16 at 18:15:02ID: 24875257
There are a few other things I would change, but it seems at a glance the piece that's making it fail is that you haven't defined changed to be global.
Put this above all your function definitions:
var changed = false;
Then, change this line:
var changed = true;
to
changed = true;