Skip to main content
Participant
June 12, 2016
Answered

Rename the fields in the interactive PDF

  • June 12, 2016
  • 3 replies
  • 2488 views

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 has been closed for replies.
Correct answer try67

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")

3 replies

Bernd Alheit
Community Expert
Community Expert
June 13, 2016

You can use a template page for this.

JR Boulay
Community Expert
Community Expert
June 13, 2016

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.

Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
June 12, 2016

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

Participant
June 13, 2016

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. !

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
June 13, 2016

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")