Repeating subform within another subform javascript issue
Hi, I am building a dynamic form. Each section is wrapped in in a subform. two sections have subforms within a parent subform. ex. form1.headersubform.childsubform.child2subform. I have a button that on the click event uses javascript code to check for empty/null field and colors the fields yellow and sets another var which prevents signature. Everything works, except for the 2 and greater instances of child2subform. The fields in header subform color fine for every repeating instance. The child2subform within the headersubform only colors for the 1st instance.
I can't find the issue in the code to get the child2subform instance to color.
My Javascript
var DDSC = form1.headersubform.childsubform.child2subform.instanceManager.count;
for (var sprec = 0; sprec < DDSC; sprec++) {
for (i = 0; i < DDS.length; i++) {
// check for null or empty value
if (isEmptyField("headersubform.childsubform.child2subformd[" + sprec + "]." + DDS[i])) {
// change the field to required
this.resolveNode("fheadersubform.childsubform.child2subform[" + sprec +"]." + DDS[i]).ui.oneOfChild.border.fill.color.value = "255, 255, 153";
missingData = true;
} else {
// change the field to normal
this.resolveNode("fheadersubform.childsubform.child2subform[" + sprec +"]." + DDS[i]).ui.oneOfChild.border.fill.color.value = "255, 255, 255";
}
}
}