Highlighted

Display filename in text field

Avatar

Guest

30-03-2009

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

Replies

Highlighted

Avatar

Guest

31-03-2009

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
Highlighted

Steve_L_Walker

31-03-2009

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.