I've downloaded an example from Adobe for Adding or Removing a row at runtime.
The example works great, But it only allows you to generate maximum of 7 rows!!!!!
I've tried to change the code but I was unseccessful. Can you help?
Here's the code for the Add button
form1.#subform[0].Add::click - (JavaScript, client)
// nTableLength stores the number of XML elements contained in Table1.
var nTableLength = Table1.nodes.length;
var nNumRow = 0;
for (var nCount = 0; nCount < nTableLength; nCount ++) {
if ((Table1.nodes.item(nCount).className == "subform") & (Table1.nodes.item(nCount).name !== "HeaderRow")) {
nNumRow = nNumRow + 1;
}
}
if (nNumRow == 7) {
xfa.host.messageBox("The maximum allowable number of rows is 7. You cannot add any more rows.", "Warning", 3);
}
else {
Table1.Row1.instanceManager.addInstance(1);
}