Skip to main content
Participant
August 16, 2016
Answered

What JavaScript would I use to add the file name to a Text Field form?

  • August 16, 2016
  • 1 reply
  • 1107 views

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.

This topic has been closed for replies.
Correct answer try67

Yes, this code:

this.getField("Name of field").value = this.documentFileName;

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 16, 2016

Yes, this code:

this.getField("Name of field").value = this.documentFileName;

Participant
August 17, 2016

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?

try67
Community Expert
Community Expert
August 17, 2016

You need to place the code as a doc-level field and then it will execute each time the file is opened.