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

How do I have box value = current year (YYYY) + A certain value in another text box field.

New Here ,
Aug 07, 2020 Aug 07, 2020

Copy link to clipboard

Copied

For example, other field = 4, therfore this new field should = 2024 (2020 + 4)

TOPICS
Create PDFs , Edit and convert PDFs , How to , PDF forms

Views

142

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 ,
Aug 07, 2020 Aug 07, 2020

Copy link to clipboard

Copied

LATEST

Let's say the other field is called "B" and the first one is called "A". Use this code as the custom calculation script of "A":

event.value = new Date().getFullYear() + Number(this.getField("B").valueAsString;

 

Note that this will only cause the value to change when you edit the value of one of the fields in the file. It won't update automatically when the year changes. To do that you would need to use a doc-level code that will execute each time the file file is opened.

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