Skip to main content
Participating Frequently
Dec 6, 2017 5:52 PM UTC
Question

Renaming or Replacing a Field name through Action Wizard Jscript (batch process) Acrobat XI Pro

I have a signature field on a form with the name "Signature of Employer or Authorized Person".

For some reason, nothing happens when I run the script like this:

var f = this.getField("Signature of Employer or Authorized Person);

I think it's due to the spaces in between the field name. I can't change the field name through Form Edit mode since I do not own the form.

Is there a way to have this field name changed or replaced with a simpler name like "signature1" via JavaScript?

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

15 replies

Legend
Dec 6, 2017 8:37 PM UTC

Have you checked the console for messages? That's where the scripts only messages and any reports will go.

Translate
Participating Frequently
Dec 6, 2017 8:58 PM UTC

Yes, this is on the console on JavaScript Debugger:

f is null.

Translate
try67
Community Expert
Community Expert
Dec 6, 2017 9:10 PM UTC

That means you're specifying an incorrect field name.

Translate
try67
Community Expert
Community Expert
Dec 6, 2017 7:14 PM UTC

JS can't rename a field. What you can do, though, is delete the old field and then create a new one in its place, with the new name.

Translate
Participating Frequently
Dec 6, 2017 7:17 PM UTC

Is there any guide/example to do this?

Sorry, I am not very good with JavaScript.

Translate
try67
Community Expert
Community Expert
Dec 6, 2017 7:20 PM UTC

This is not a simple task if you don't have any experience with Acrobat JS.

The full documentation is available here: Adobe - Acrobat Developer Center | Adobe Developer Connection

Translate
Joel Geraci
Community Expert
Community Expert
Dec 6, 2017 6:09 PM UTC

You are missing the close quote in your code.

var f = this.getField("Signature of Employer or Authorized Person");

Translate
Participating Frequently
Dec 6, 2017 7:08 PM UTC

I missed that while posting the question here ... wasn't copying from the code ...

Have it exactly like this in my code:

var f = this.getField("Signature of Employer or Authorized Person");

Still doesn't work.

Translate