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

Calculation Fields

New Here ,
Sep 20, 2022 Sep 20, 2022

Copy link to clipboard

Copied

Hello,

I have a date field A with the format dd/mm/yy. In a field B, I want to have a calculation of A + 2 years. How should I do it ?

Thank you for your help.

TOPICS
PDF forms

Views

314

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

correct answers 1 Correct answer

Community Expert , Sep 20, 2022 Sep 20, 2022

Use this as a validation script of field A:

if(event.value == "")
this.getField("B").value = "";
else{
var year = util.scand("dd/mm/yy", event.value)
year.setFullYear(year.getFullYear() +2);
this.getField("B").value = util.printd("dd/mm/yy", year);}

Votes

Translate

Translate
Community Expert ,
Sep 20, 2022 Sep 20, 2022

Copy link to clipboard

Copied

Use this as a validation script of field A:

if(event.value == "")
this.getField("B").value = "";
else{
var year = util.scand("dd/mm/yy", event.value)
year.setFullYear(year.getFullYear() +2);
this.getField("B").value = util.printd("dd/mm/yy", year);}

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 ,
Sep 20, 2022 Sep 20, 2022

Copy link to clipboard

Copied

LATEST

It's perfect, thanks 😉

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