Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

removeInstance removing wrong instance

Using LiveCycle Designer 8.1.1(.2188.1.406459) I've built a form that has a section that allows the user to add a single image per page using repeating subforms. There is an 'add page' and 'remove page' button. When testing the form, the 'add page' functions correctly, but the 'remove page' function always removes the last instance of the subform. I'm currently using the 'subform.removeInstance(this.parent.index)' approach which is working fine for me on other forms ... but this one has me stumped. If I modify the script for this button by changing (this.parent.index) to (this.index) or (this.parent.parent.index) I get the same results each time, which surprises me in itself that all of them would at least delete something!

I've read every post I can find on this topic and have tried every approach mentioned, but every one of the ways possible to organize subforms and buttons, etc., every scripting approach I've tried renders the same results (when they work at all).

Since I've had success with this approach in other forms, I expected this to be a simple task, but so far it's consumed way too much time and I've got an unacceptable result.

Any help is much appreciated!
9 Replies


Level 9
Hi Rick

This often happens because the Remove button is nested inside several levels of subform, so you need to add more parent.parent.parent steps. (This may not be the problem, but worth a shot.)

One trick is to add some script to your remove button that does this:"Button SOM:" + this.somExpression);

This will tell you what the SOM expression of your button is, and should give you a clue as to how many "parents" you need.

You can also add:"Parent Index:" + this.parent.parent.index);

Howard, thanks for the reply. I tried multiple additional levels of '.parent' to no avail ... no matter how many I add, it's still the last one that gets deleted.

I added: ""Parent Index:" + this.parent.parent.index);" and see that no matter how many repeated subforms get added, they each return "Parent index:0".

I also tried ""Button SOM:" + this.somExpression);" and
this was the result (should there be two form tags?).

Thanks again for any further thoughts you can offer.


Level 9
Please post the PDF/XDP somewhere, or send it to

I have a similar problem, but I find that it's not the subform being deleted incorrectly, it's the Imagefield within the subform being incorrectly not deleted.

Eg, I load four subform instances with an image and a texbox

1) ImgA Text1

2) ImgB Text2

3) ImgC Text3

4) ImgD Text4

After removing 2) I get

1) ImgA Text1

2) ImgB Text3

3) ImgC Text4

So .removeInstance is finding the right subform, but the images are somehow maintaining the sequence and being lopped off from the end.

I think this might be the issue for above. I'd also love there to be a solution out there (this is the first reference I've found on the web after several hours googling).


Peter, Howard (see above reply) and some of his cohorts at Avoka were kind enough to take a look at my form to see if they could determine the source of the issue. They're conclusion:


"This appears to be a bug with Reader 8.1.0 and 8.1.1 and we will raise with Adobe. The issue is with the image field inside the repeating subform.

The only workarounds that we can offer at this stage is for you to specify that users must be on Reader 8.0.0 or to remove the image field. I understand that these may not be attractive options for you.

I can also confirm that this bug does not occur with Reader 8.0.0, 7.0.9 nor 7.0.8".


Unfortunately, I can't specify an earlier version of Reader since I'm relying on certain functionality that those versions can't support.

At least knowing this has saved me from any further brow bruising as the head banging has ceased.
Thanks muchly Rick (and others) .. I'll stop my own headbanging...


I had this same issue. My resolution was to use the subform name . index. SubFormName.index If you want to use this.parent.index You have to make sure for each subform above the current button you add a parent this this command. My button was 4 subforms deep so I would have to do "this.parent.parent.parent.parent.index" which does work but if I move this button then I would have to change this code.

I am having the same exact problem. I have a page with an image field that the user can dynamically add and remove. Except when the remove button is clicked, the last page is always removed. Or with other scripts, nothing happens.

I am currently using Acrobat 9 Pro and it is still a problem. Is there a new work around for this? I haven't been able to figure anything out.


Level 10
What command are you using to remove the image?