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

SOLVED

How do you delete "added" pages in flowed form

paul_a_showalte
Level 1
Level 1

I have a two page form. On page two, there is a button that allows the user to add a new page (instance), which we can call page 2.2. They can do that as many times as they want (ex. if they click on the add new page button three times, you would now have a five page form, page 1, page 2.1, page 2.2 page 2.3, and page 2.4.)

I also have a clear form button on page one, that allows them to clear the form. I would like the clear form button to remove all "added" pages, so when cleared, the form has the original page one and page two, and no additional pages.

Thanks for any help you can offer.

1 Accepted Solution
Niall_O_Donovan
Correct answer by
Level 10
Level 10

Hi,

If you look at the reset button in this from, you will see a loop to go through and remove the instances and reset the form.

https://acrobat.com/#d=KVeR0qUe9TMd0CCRBEeFTA

A similar approach would work for repeating pages.

Good luck,

Niall

View solution in original post

2 Replies
Niall_O_Donovan
Correct answer by
Level 10
Level 10

Hi,

If you look at the reset button in this from, you will see a loop to go through and remove the instances and reset the form.

https://acrobat.com/#d=KVeR0qUe9TMd0CCRBEeFTA

A similar approach would work for repeating pages.

Good luck,

Niall

View solution in original post

paul_a_showalte
Level 1
Level 1

Thanks for the lead on the correct script.

I used what you had, but tweaked it to look at the total number of pages (which is where you were directing me).

The script is below. Since I know I only want to have two pages in the form, this cycles through and deletes those pages we don't need.

while (xfa.host.numPages > 2)

{

    _page2.removeInstance(1);

}

I actually prefer people going back to a clean form, but my customer wanted the end users to be able to just start over with the current form.

This form has four barcodes, two on each page, that are populated on print. Plus field validations all over the place. When complete, I will post the various scripts so others can use as a resource.

Thanks again. This problem is solved.