I have a (mainly) single page XFA document with various fields to be filled out by the user. I am adding a button with a script at the bottom of the page to duplicate the page after the user has completed it. Once duplicated, all the data from Page 1 is populated to the respective fields on Page 2 using global binding, except for one particular field which will require the user's input on each subsequent page.
I want to be able to loop through all the fields on each new instance of the first page (except the one particular field) and make their access 'readOnly', I just don't know the best or most efficient way to tackle it!
Here is an example of my thought process:
for (var nPageCount = 1; nPageCount < xfa.host.numPages; nPageCount++) {
var oFields = xfa.layout.pageContent(nPageCount, "field");
var nNodesLength = oFields.length;
for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) {
oFields.item(nNodeCount).access = "readOnly";
}
xfa.resolveNode("form1.mainPage["+nPageCount+"].Subform7.DropDownList.Background.Search").access = 'open';
xfa.resolveNode("form1.mainPage["+nPageCount+"].Subform7.DropDownList.Results.ResultList").access = 'open';
}
I placed the above code in the indexChange event in both 'form1' and 'mainPage' but neither worked. Any ideas?