Skip to main content
Participating Frequently
Oct 7, 2020 4:57 PM UTC
Question

Reset PDF Form

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 is closed to new replies. Start a new post to keep the conversation going.

12 replies

Bernd Alheit
Community Expert
Community Expert
Oct 7, 2020 5:36 PM UTC

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

Translate
try67
Community Expert
Community Expert
Oct 7, 2020 8:24 PM UTC

Inside an array, though. Like this:

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

Translate
phendelAuthor
Participating Frequently
Oct 7, 2020 9:25 PM UTC

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.

Translate