Skip to main content
Participating Frequently
December 6, 2017
Question

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

  • December 6, 2017
  • 3 replies
  • 2283 views

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

3 replies

Legend
December 6, 2017

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

Participating Frequently
December 6, 2017

Yes, this is on the console on JavaScript Debugger:

f is null.

try67
Community Expert
Community Expert
December 6, 2017

That means you're specifying an incorrect field name.

try67
Community Expert
Community Expert
December 6, 2017

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.

Participating Frequently
December 6, 2017

Is there any guide/example to do this?

Sorry, I am not very good with JavaScript.

try67
Community Expert
Community Expert
December 6, 2017

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

Joel Geraci
Community Expert
Community Expert
December 6, 2017

You are missing the close quote in your code.

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

Participating Frequently
December 6, 2017

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.