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

Add 60 Days from input Date field into another field

Community Beginner ,
Mar 11, 2021 Mar 11, 2021

Copy link to clipboard

Copied

I am very much a novice when it comes to script.

 

However, I have this Date picker field, called "Issue Date". and I want it to calculate +60 days from the date selected in the Issue Date field and input it in another field called "Expiration Date"

 

Please explain to me how I can do that?  Where do I put in the code and what the code should be?

 

Thank you!

 

Drew

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

Views

871

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 , Mar 11, 2021 Mar 11, 2021

As "Validation script" of "Issue Date" field use this:

if(event.value == "")
this.getField("Expiration Date").value = "";
else{
var days = util.scand("dd-mmm-yyyy", event.value)
days.setDate(days.getDate() +60);
this.getField("Expiration Date").value = util.printd("dd-mmm-yyyy", days);}

 

 

Change date format from "dd-mmm-yyyy" to something else if you wish.

Votes

Translate

Translate
Community Expert ,
Mar 11, 2021 Mar 11, 2021

Copy link to clipboard

Copied

As "Validation script" of "Issue Date" field use this:

if(event.value == "")
this.getField("Expiration Date").value = "";
else{
var days = util.scand("dd-mmm-yyyy", event.value)
days.setDate(days.getDate() +60);
this.getField("Expiration Date").value = util.printd("dd-mmm-yyyy", days);}

 

 

Change date format from "dd-mmm-yyyy" to something else if you wish.

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 Beginner ,
Mar 11, 2021 Mar 11, 2021

Copy link to clipboard

Copied

LATEST

wow!  This is perfect!

 

Thank you so much!!  This is a huge help to the project I was working on!! 

 

 

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