• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

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

New Here ,
Apr 17, 2024 Apr 17, 2024

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.

TOPICS
JavaScript

Views

253

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 17, 2024 Apr 17, 2024

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 26, 2024 Apr 26, 2024

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 26, 2024 Apr 26, 2024

Copy link to clipboard

Copied

LATEST

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 PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 17, 2024 Apr 17, 2024

Copy link to clipboard

Copied

Read this article:

https://www.pdfscripting.com/public/PDF-Form-Scripting.cfm

 

 

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines