Skip to main content
Known Participant
Jul 24, 2017 5:55 PM UTC
Question

Replace part of the fields name

hi, in my form, field names are like bellow..

primary-fn-lastname

primary-fn-firstname

primary-fn-middlename

I want to replace "primary" with "child-3". so new fields names should be like bellow. is this possible to do using javascripts??. thanks in advance.

child-3-fn-lastname

child-3-fn-firstname

child-3-fn-middlename

This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

try67
Community Expert
Community Expert
Jul 24, 2017 9:21 PM UTC

JS can't rename fields. It can only create new fields in the same location with the new name, and then delete the old ones.

In this process all of the Actions, Format, Validation, Calculation, Keystroke, etc. that are associated with the fields will be lost, though.

Translate
Bernd Alheit
Community Expert
Community Expert
Jul 24, 2017 6:38 PM UTC

Want you create new form fields?

Translate
omanbuxAuthor
Known Participant
Jul 25, 2017 12:44 AM UTC

hi, thanks a lot for your reply. is that possible to send code to create new fields using new field names. don't worry about field formatting because there are no special formatting in my fields.. thanks..

Translate
Bernd Alheit
Community Expert
Community Expert
Jul 25, 2017 5:19 AM UTC

Look at the method addField in the Acrobat JavaScript Reference.

Translate