Good morning, all.
My document contains two dynamic subforms. subformA contains a dynamic subform, containing some fields and a button to remove the instance, along with a button to add new instances of the dynamic subform.
subformB contains a subform which is created whenever the add button above is clicked. Its contents don't matter to this question.
That is, clicking the add button in subformA creates two subforms, one in subformA and one in subformB. This works.
But sometimes I need to remove one of the inner subforms from subformA; if I do so, I need to remove the corresponding subform from subformB. Clicking the remove button removes the correct subform from subformA. The index of the subform I want to remove is the same in both subforms.
I have tried many statements to remove the subform from subformB. What command should I be using to delete it? I know I need to use removeInstance but I am having a great deal of difficulty in determining the som.
var nIdx = subformA.dynSubform.index;
subformA._dynSubform.removeInstance(nIdx);
subformB._dynSubform.removeInstance(nIdx);
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script