Karl Blessing
Programmer
I have here a javascript function, it works for some of the stuff.
[tt]
function ShowChild(HID, LID, status)
{
var list = '';
for(var j=0; j<=max; j++)
{
if ((tree[j][3] == HID) & (tree[j][4] == LID))
{
document.all(tree[j][2]).checked = status;
alert(tree[j][2] + " Been checked to " + status);
spnum += 1;
retshow = ShowChild(tree[j][0],tree[j][1], status)
spnum -= 1;
if (retshow != '')
list = list + "\n" + spaces(spnum) + tree[j][2] + retshow;
else
list = list + "\n" + spaces(spnum) + tree[j][2];
}
}
return list;
}
[/tt]
assuming that
document.all(tree[j][2]).checked = status;
(tree[j][2] = name of object)
is the checkbox, it works for any checkbox that doesnt have another checkbox of the same name, because if there are checkboxes with the same names, setting true to it doesnt work, even tho my alert says it has been set for that particular one.
is there a way to check an object if it's an array, and if it is, how to loop thru and make each one the status that I want.
[sig]<p>Karl<br><a href=mailto:kb244@kb244.com>kb244@kb244.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
[/sig]
[tt]
function ShowChild(HID, LID, status)
{
var list = '';
for(var j=0; j<=max; j++)
{
if ((tree[j][3] == HID) & (tree[j][4] == LID))
{
document.all(tree[j][2]).checked = status;
alert(tree[j][2] + " Been checked to " + status);
spnum += 1;
retshow = ShowChild(tree[j][0],tree[j][1], status)
spnum -= 1;
if (retshow != '')
list = list + "\n" + spaces(spnum) + tree[j][2] + retshow;
else
list = list + "\n" + spaces(spnum) + tree[j][2];
}
}
return list;
}
[/tt]
assuming that
document.all(tree[j][2]).checked = status;
(tree[j][2] = name of object)
is the checkbox, it works for any checkbox that doesnt have another checkbox of the same name, because if there are checkboxes with the same names, setting true to it doesnt work, even tho my alert says it has been set for that particular one.
is there a way to check an object if it's an array, and if it is, how to loop thru and make each one the status that I want.
[sig]<p>Karl<br><a href=mailto:kb244@kb244.com>kb244@kb244.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
[/sig]