These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Selecting and deleting the values from a group of fields

AndrewAlb
Registered: Aug 16 2007
Posts: 97

Is it possible to select a group of fields in adobe acrobat pro 8 and empty their values?
 
My form fields are broken up into sections; 1A, 1B, 2A, 2B etc.
Each section containing multiple form fields.
 
I would like to implement a function that when the user checks a certain checkbox all the values in the fields in a section are deleted. Obviously I could hide them but this is not an option for me, I need to delete their values.
 
I was thinking I could put the values in an array and then just walk through the array deleting values but I thought I would see if there was a smarter way - a more dynamic way where I didn't have to list out all the fields in each section.
For example is there a way to build the array programatically?
 
Any help would be appreciated.

Andrew D. Albrecht, MS
Solutions Developer
ING USFS

My Product Information:
Acrobat Pro 8.0999999999999996447286321199499070644378662109375, Windows
tedpadova
ExpertTeam
Registered: Dec 31 2005
Posts: 848
Yes, there's a relatively easy way to handle this problem. First off, to make it easy, you need to name your fields with hierarchical names with a different parent name for each section. Something like one.name, one.address; two.item, two,amount; three.creditCard, three.shiping, etc. Just be certain that each group has a separate parent name.

Add a button for the first group and add a JavaScript action. In the JavaScript Editor add the following script for the first group:

var fields = new Array();
fields = "one";
this.resetForm(fields);

Next button might have a script like:

var fields = new Array();
fields = "two";
this.resetForm(fields);

And so on.

ted

The author of numerous books on Acrobat, Photoshop, Illustrator and the Adobe Creative Suite, and an international speaker on Adobe Acrobat, Ted Padova is a well-known PDF guru.

AndrewAlb
Registered: Aug 16 2007
Posts: 97
Perfect - Thank you very much!

Andrew D. Albrecht, MS
Solutions Developer
ING USFS