Forgive me for posting what may be a silly question for most. I am a newbie to scripting and Adobe Forms. I found some code to allow me to dynamically add rows to my form, but I do not know what to change in the code to allow me to add more than 7 rows. Can anyone point me in the right direction? Any help is greatly appreciated.
form1.#subform[0].Add::click - (JavaScript, client)
// nTableLength stores the number of XML elements contained in Table1.
var nTableLength = Table1.nodes.length;
// nNumRow is used to calculate the number of rows contained in Table1.
var nNumRow = 0;
// This script uses a For loop to cycle through all of the XML elements
// contained in Table1.
for (var nCount = 0; nCount < nTableLength; nCount ++) {
// If the current XML element in Table1 is of type subform and it
// is not a header row, then increment the variable nNumRow by one.
// If the table included a footer row, this script would have to
// account for it.
//
// Note: In the Adobe XML Form Object Model, all table rows are
// considered subform objects.
if ((Table1.nodes.item(nCount).className == "subform") & (Table1.nodes.item(nCount).name !== "HeaderRow")) {
nNumRow = nNumRow + 1;
}
}
// An if-else statement is used to prevent form fillers from adding
// more than the maximum number of seven rows to a table.
if (nNumRow == 7) {
xfa.host.messageBox("The maximum allowable number of rows is 7. You cannot add any more rows.", "Warning", 3);
}
else {
// This script uses the addInstance() method to add a new instance
// of the Row1 object contained in Table1.
Table1.Row1.instanceManager.addInstance(1);
}
Table1.Row1.instanceManager.addInstance(1);
radzmar
• LoveCycle Blog
Documents you need:
• LiveCycle Designer ES2 Docs