Copy link to clipboard
Copied
Without being a JavaScript novice, it there a JavaScript that I can cut and past that would automatically add the file name to a Text Field in the form when the form is opened?
Thanks Much.
Yes, this code:
this.getField("Name of field").value = this.documentFileName;
Copy link to clipboard
Copied
Yes, this code:
this.getField("Name of field").value = this.documentFileName;
Copy link to clipboard
Copied
Thank you very much. Is there a way to have it automatically update without having to click on the text box once the file is opened?
Copy link to clipboard
Copied
You need to place the code as a doc-level field and then it will execute each time the file is opened.
Copy link to clipboard
Copied
If you mean that you want it to update after you save the file under a new name, then you can also put it under the document's Did Save action.
Copy link to clipboard
Copied
How do you 'place the code as a doc-level field'?
Copy link to clipboard
Copied
Go to Tools - JavaScript - Document JavaScripts and insert it there under a new item called "scripts" (for example).
Copy link to clipboard
Copied
Sorry if I'm driving you crazy but. I'm in an Adobe Acrobat Pro form. I'm entering the JavaScript in the text field 'Properties' 'Actions'. I can't find a Tools - JavaScript - Document JavaScripts anywhere in Adobe.
The text field will populate but only if I click on it manually after I open the form.
Copy link to clipboard
Copied
Don't put the code there. Put it where I specified... Do you see the Tools button in the application? If so, click it and continue from there.
Copy link to clipboard
Copied
Found it. Thanks a bunch!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now