Skip to main content
Known Participant
July 24, 2017
Question

Replace part of the fields name

  • July 24, 2017
  • 2 replies
  • 456 views

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

2 replies

try67
Community Expert
Community Expert
July 24, 2017

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.

Bernd Alheit
Community Expert
Community Expert
July 24, 2017

Want you create new form fields?

omanbuxAuthor
Known Participant
July 25, 2017

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

Bernd Alheit
Community Expert
Community Expert
July 25, 2017

Look at the method addField in the Acrobat JavaScript Reference.