global/local var in a function
| From: | Alex Elderson | Date: | Thu, 10 Jan 2002 11:44:11 +0000 |
| Subject: | global/local var in a function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-80013@lists.php.net to get a copy of this message | ||
Hi,
I have a little problem with a function. It calls him self and the var i is
lost! after the call!
can anybody help me?
(it's javascript)
function change_check_all(tree_item) {
a = document.all[tree_item + "_check"];
b = document.all[tree_item + "_count"];
for(i=0;i<b.value;i++) {
if (a.value=="off") {
change_check_to(tree_item + "_" + i, 0);
} else {
change_check_to(tree_item + "_" + i, 1);
}
change_check_all(tree_item + "_" + i, i);
}
}