Skip to main content
Participant
Jun 12, 2016 2:12 PM UTC
Answered

Rename the fields in the interactive PDF

I did create an interactive pdf in indesign

I did open the document with acrobat and fill the fields.

now I did dublicate the page to fill the fields with new informations

because the fields have the same name, the new informations will be filled in both pages and I lose

the informations in page1.

now renaming 100 fields is a time consuming.

how can I rename the fields with a script?

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Jun 13, 2016 2:31 PM UTC

That doesn't do anything. It will not error out but it will also not rename the fields. The "name" property is read-only.

If after running this code you run this command it will return null: this.getField("field19")

7 replies

Bernd Alheit
Community Expert
Community Expert
Jun 13, 2016 1:01 PM UTC

You can use a template page for this.

Translate
JR Boulay
Community Expert
Community Expert
Jun 13, 2016 11:15 AM UTC

Hi.

Here is a workaround:

Copy these 100 fields and paste them in a blank PDF twice as large as the original.

Select all field, right-clic and "Create multiple copy". Choose 1 more vertically or horizontally.

This will rename all field as 2 different sets.

Then copy-paste back the first set of fields on page 1 and the second set on page 2 in the original PDF.

Translate
Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
Jun 12, 2016 2:56 PM UTC

It's not possible to rename fields using a script. It's only possible to re-create the fields using the new name.

Translate
Participant
Jun 13, 2016 2:28 PM UTC

I did try this

1. select all fields

2. Ctrl + i

3. in the action section I did type:

function rename()

{

    for(i=19; i<=102; i++) {

        var fields = this.getField("Date" + " " + i);

        fields.name = "field" + i;

    }

}

the result I want is:

befor renaming    Date 19.

after renaming     field 19.

I am not a master in programming but the idea is:

with a loop access the field name propertie and change it

I don't know, maybe this will give a hint .... or not. !

Translate
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Jun 13, 2016 2:31 PM UTC

That doesn't do anything. It will not error out but it will also not rename the fields. The "name" property is read-only.

If after running this code you run this command it will return null: this.getField("field19")

Translate