0
New Here
,
/t5/acrobat-sdk-discussions/date-formula/td-p/14845775
Sep 06, 2024
Sep 06, 2024
Copy link to clipboard
Copied
Hi all,
Hope someone can help. Is it possible to have a formula that adds only the next month from the field before.
I need date2 to show 05-Nov-2024
date3 to show 05-Nov-2024
date4 to show 05-Dec-2024
date5 to show 05-Jan-2025
So the year would also need to update when a new one is reached.
Is this possible?
Cheers
Chris
TOPICS
Acrobat SDK and JavaScript
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Community Expert
,
Sep 06, 2024
Sep 06, 2024
Hi,
In validation script of your "Date1" field you write:
var oDate=util.scand("dd-mmmm-yyyy",event.value);
for (var i=2; i<=12; i++) {
oDate.setMonth(oDate.getMonth()+1);
this.getField("Date"+i).value=util.printd("dd-mmmm-yyyy",oDate);
}
@+
Community Expert
,
/t5/acrobat-sdk-discussions/date-formula/m-p/14845959#M93411
Sep 06, 2024
Sep 06, 2024
Copy link to clipboard
Copied
Hi,
In validation script of your "Date1" field you write:
var oDate=util.scand("dd-mmmm-yyyy",event.value);
for (var i=2; i<=12; i++) {
oDate.setMonth(oDate.getMonth()+1);
this.getField("Date"+i).value=util.printd("dd-mmmm-yyyy",oDate);
}
@+
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Cjj1984
AUTHOR
New Here
,
LATEST
/t5/acrobat-sdk-discussions/date-formula/m-p/14845973#M93412
Sep 06, 2024
Sep 06, 2024
Copy link to clipboard
Copied
Thanks you so much
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

