Skip to main content
cburg66
Participant
November 7, 2018
Answered

"Reset Form Button" that Clears Form and Deletes Pages.

  • November 7, 2018
  • 2 replies
  • 2337 views

I have created a form that works pretty well for me. On the top of the form, I have a button to reset the form. This works great and clears all the fillable fields when clicked. On the bottom of the form I have a button to add an additional page from a hidden template, this also is working well and I can add as many new pages as needed. Is there a way that I can add JavaScript to the "Reset Form" button at the top of the page that will delete all of the pages that were added by the button at the bottom of the form? I'd like for the form to become the single page that I started with when I click the "Reset Form Button".

(I am using Adobe Acrobat Pro DC on a Windows 10 Machine.)

Thank you in advance for any assistance you can provide.

This topic has been closed for replies.
Correct answer try67

Sure. Let's say that before you spawn any pages the file has 10 pages.

You can use this command to delete pages 11-<last page>:

this.deletePages(10, this.numPages-1);

2 replies

Inspiring
May 4, 2023

Hi!

 

I don't know if it's okay to ask this but if it is, would you mind explaining how you set it up so that the user is able to add an additional page from a hidden template?

 

I understand the part about adding a button but when I looked at the button options I didn't see an option to add an additional page from a hidden template.

 

I would love to be able to do this for a fillable proposal form that sometimes needs to be more than one page.

 

Thank you so much!

Diane

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
November 7, 2018

Sure. Let's say that before you spawn any pages the file has 10 pages.

You can use this command to delete pages 11-<last page>:

this.deletePages(10, this.numPages-1);

cburg66
cburg66Author
Participant
November 7, 2018

That worked brilliantly! Thank you so much!

[Private info removed. -Mod]

Known Participant
October 21, 2022

Would you be kind enough to share the whole code?