Skip to main content
Participating Frequently
October 7, 2020
Question

Reset PDF Form

  • October 7, 2020
  • 1 reply
  • 1090 views

I have an acrobat form with 2 pages. Page 1 is interview questions with open-ended text boxes to record responses and page 2 has more interview questions, but the possible responses are in dropdown boxes instead of open-ended textboxes. A dropdown on page 2 ('Type') currently has a keystroke event to reset the entire form. Once you change the selection on this 'Type' dropdown, the entire document is reset. The keystroke event is :  

if (event.willCommit) this.resetForm()

 

I want to reset the dropboxes on page 2 only, but leave the textboxes on page 1 untouched. How do I do this in Javascript?

This topic has been closed for replies.

1 reply

Bernd Alheit
Community Expert
Community Expert
October 7, 2020

As parameter of resetForm you can specify names of form fields.

try67
Community Expert
Community Expert
October 7, 2020

Inside an array, though. Like this:

this.resetForm(["Field1", "Field2", "Field5"]);

phendelAuthor
Participating Frequently
October 7, 2020

The code I am getting to run in the keystroke event is as follows:

if(event.willCommit) this.resetForm(["Dropdown.1"];

However, when I add more fields, such as dropdown2, etc, the code stops working. For example, this one is not working:

if(event.willCommit) this.resetForm(["Dropdown.1", "Dropdown.2"];

 

I even use hierarchical names to make the coding a bit easier, but no luck.