Skip to main content
Participant
April 17, 2024
Question

moving a date-picker value into a string through a custom calculation script

  • April 17, 2024
  • 2 replies
  • 618 views

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.

This topic has been closed for replies.

2 replies

Thom Parker
Community Expert
Community Expert
April 17, 2024
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Nesa Nurani
Community Expert
Community Expert
April 17, 2024

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.

Participant
April 26, 2024

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.

Thom Parker
Community Expert
Community Expert
April 26, 2024

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. 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often