I have a script that I'd like to use to count how many checkboxes are checked in a particular subform. Problem is that I have several subforms with checkboxes, and I only want to evaluate checkboxes in a certain subform. The following script works, but again, looks at all checkboxes on the entire form.
What if statement would I need if I wanted to limit the function to only work on the subform named Employee_Info? I just can't figure out how to specify a subform name and compare it to the subform name of each checkbox. I hope that makes sense.
function countChk(vNode) {
if (vNode.className === "field") {
if (vNode.ui.oneOfChild.className === "checkButton") {
if (vNode.items.nodes.length > 1) {
if (vNode.value.oneOfChild.value == 1) {
nChk++ ;
}
}
}
}
for (var i = 0; i < vNode.nodes.length; i++) {
countChk(vNode.nodes.item(i));
}
}