Expand my Community achievements bar.

Alert box for addInstance max and validation on addInstance

Avatar

Level 2
I have read the section about the instance manager to control subforms in LiveCycle Designer Scripting Basics. What I am trying to do is have a popup appear when the subform max has been met.



What is in the manual is below and I am confused with the word 'methods'?



if (methods.Subform2.instanceManager.count ==

methods.Subform2.instanceManager.max) {

xfa.host.messageBox("You have reached the maximum number of items allowed.",

"Instance Manager Methods", 1);

}

else {

methods.Subform2.instanceManager.addInstance(1);

xfa.form.recalculate(1);

}



Also I have validations on the first subform, but they are not carried to the additional subforms added. How can I accomplish this?



I am using LiveCycle (7.0) that came with Acrobat Professional.



I have figured out how to get the popup to appear.



if (Subform1._Subform2.count == Subform1._Subform2.max)

{

app.alert("You have reached the maximum number of items allowed.",3,0);

}

else

{

Subform1._Subform2.addInstance;

xfa.form.recalculate;



Now the only thing is how to validate each subform that is added?
0 Replies