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
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.
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.
Copy link to clipboard
Copied
wow! This is perfect!
Thank you so much!! This is a huge help to the project I was working on!!

