Copy link to clipboard
Copied
I have a built-in date picker on the page 1 of my pdf. On page 3, there is a label field for me to piece together info on the page 1. I have spent three days, without success, on finding a refrence about extracting the page-1 date-picker value (FailureDate) into a string. Javascript formula like util.printd("mm/dd/yyyy", this.FailureDate) and util.printd("mm/dd/yyyy", this.getField("FailureDate")) do not work. Please help. Thanks.
Copy link to clipboard
Copied
If you want to get value of the field, use like this:
this.getField("FailureDate").valueAsString;
A little more explanation of what exactly you want to do and what script you already have would help us to better understand and help you.
Copy link to clipboard
Copied
this.getField("FailureDate_af_date").valueAsString has worked. I guess that af_date has to do with an date picker being the object. Thanks a lot for your kind help.
Copy link to clipboard
Copied
You have completely missed the point. The code you posted is non-sense. If you want to write scripts for Acrobat then you have to actually use the Acrobat JS reference (as opposed to making things up) and maybe read some articles on how to use it.
And there is no date picker object.
Copy link to clipboard
Copied
Read this article:
https://www.pdfscripting.com/public/PDF-Form-Scripting.cfm