Hi,
You code has got a bit mangled , but maybe something like;
var cChoice = app.popUpMenu("Add a blank section", "Copy this section", "-", "Delete this section");
if(cChoice == "Add a blank section")
{
ACT.instanceManager.addInstance(1)
}
else
if(cChoice == "Delete this section")
{
ACT.instanceManager.removeInstance(this.parent.instanceIndex)
}
else if(cChoice == "Copy this section")
{
var cResponse = app.response("How many instances of this section would you like to insert?",["Copy current section",])
if (cResponse == null)
{
app.alert("No copy of the current section was inserted due to a null response.");
}
else
{
var i=ACT.instanceIndex
var j=0
while(j<cResponse)
{
var act = _ACT.addInstance(1)
act.Row1.textField.rawValue = xfa.resolveNode("form1.Subform1.ACT.Row1.textField").rawValue
j++;
}
}
}