I am kind of a newbie in LC Designer, and have come upon a problem that I'm not sure how to solve.
I have created a subform called NextOfKin that contains some textfields and radiobuttons. In addition I have an Add and a Remove button in another subform, these are intended to add and remove instances of the NextOfKin subform.
So far I have succeeded in making the Add button work by using the instanceManager and addInstance. I have also made sure that the Remove button only appears if you have more than one instance of the NextOfKin subform (using a counter).
However, I am stuck when it comes to scripting the click event on the Remove button, mostly because I don't know how to reference the most recent instance of the NextOfKin subform (to be able to remove it).
Can anyone help me with the syntax?
However, the most common way to setup a delete button is to place it inside the repeatable subform. Then the instance to delete is the instance ID of the current subform.
The code should be something like this, in the click event for the delete button:
_NextOfKin.removeInstance(this.parent.index);
Have you see this video?
https://admin.adobe.acrobat.com/_a200985228/p87746471/
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script