Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Display filename in text field

Not applicable
Hi, A simple question; how can I insert the pdf filename (without the file path) as a read only value in a text field. As this is not available as a Runtime property is there a script for this?



Thanks!



Sam
4 Replies
pguerett
Level 10
Level 10
Yes ...use the command:

event.target.documentFileName
Not applicable
Thanks. However I don't seem to be getting anything - the field remains blank. I wonder if I am entering the command in the wrong place - can you offer any specific instruction on where this command should be placed? Cheers
Steve_L_Walker
Level 10
Level 10
In the initialize event for the text field, add the following client-side JavaScript:



this.rawValue = event.target.documentFileName;



Note, when you preview the PDF in Designer you will see an odd file name like _13fs18f3v9eeb3qs.pdf. When the PDF is opened in Reader or Acrobat you will see the real file name.
Not applicable
That works perfectly. Thanks for your help.