RE: [PHP] global/local var in a function

2002-01-10 Thread Niklas Lampén
This is because it creates a new thread, atleast I think it so. Use global variables to prevent this from happening: i = 0; function change_check_all(tree_item) { a = document.all[tree_item + _check]; b = document.all[tree_item + _count]; // changed the line below for(i =

RE: [PHP] global/local var in a function

2002-01-10 Thread Martin Towell
change for(i=0;ib.value;i++) { to for(var i=0;ib.value;i++) { javascript is treating i as a global var so when you call itself, global i gets changed which will bugger up your loop - I've done this s many times and spent t many hours trying to debug, just to find I forgot to