


I have a form with a hidden subform containing first and last name fields ("Main.Individual.Applicant.AppName.FirstName" and "Main.Individual.Applicant.AppName.LastName"). The binding tab on the subform (called Individual) is set to repeat subform for eatch data item, Min count 0 and Max count 4.
I have a numeric field (ApplicantNum) in a separate subform (Main.BorrowerType.IndividualApplicant.ApplicantNum) that contains the following script (on exit) to generate the correct number of instances of the subform required. So if 2 is entered in the box then 2 instances of the "Individual" subform appears.
var nApplicantNum = parseInt(this.rawValue,10);
if (nApplicantNum > 0) {
_Individual.setInstances(nApplicantNum);
}
else {
_Individual.setInstances(0);
Main.BorrowerType.IndividualApplicant.ApplicantNum.mandatory = "disabled";
}
I also have four (static) signature fields hidden elsewhere the form. If 2 is entered in the above ApplicantNum box, 2 of these signature fields will appear.
My problem: I need to to be able to loop through the instantiated instances of the "Individual" subform and concatenate the first name field and last name fields and have these inserted into the appropriate applicant signature subform which contains a single field called "FullName......Signatures.Applicant1Signature.FullName and Signatures.Applicant2Signature.FullName (assuming there are 2 applicants).
Any help with this would be most appreciated.
Thanks
Michael
Views
Replies
Sign in to like this content
Total Likes
You can use the resolveNodes() method to get a nodeList of repeated objects you the can process by a for loop.
var oSubforms = Main.resolveNodes("Individual[*]");
if (oSubforms.length > 0) {
for (var i = 0; i < oSubforms.length; i += 1) {
var cResult = "";
cResult += oSubforms.item(i).Applicte.AppName.FirstName.rawValue;
cResult += " ";
cResult += oSubforms.item(i).Applicte.AppName.LastName.rawValue;
Signatures.resolveNode("Applicant" + (i+1) + "Signature").FullName.rawValue = cResult;
}
}
Views
Replies
Sign in to like this content
Total Likes