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

23

Likes

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);}

Likes

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);}

Likes

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 😉

Likes

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