Acrobat User Community Forums

You are not logged in.     Log in to your AUC account.     Don't have an account? Sign up today

#1 2007-11-05 09:59:16

andrewalb
Member
Registered: 2007-08-16
Posts: 15

Selecting and deleting the values from a group of fields

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.


My Product Information:
Acrobat Pro 8.1 / Windows

Offline

 

#2 2007-11-09 18:07:45

tedpadova
Member

Registered: 2007-04-30
Posts: 69

Re: Selecting and deleting the values from a group of fields

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

Offline

 

#3 2007-11-16 07:45:10

AndrewAlb
Member
Registered: 2007-08-16
Posts: 15

Re: Selecting and deleting the values from a group of fields

Perfect - Thank you very much!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson

AcrobatUsers.com  >>  User Groups • News • Events • Articles • Blogs • How To • Resources • Member Log in