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

Inserting an auto-populate date that is a year from another auto-populated date

New Here ,
Jun 23, 2021 Jun 23, 2021

Copy link to clipboard

Copied

I inserted a field that has today's date auto-populate. I want to create another field that will auto-populate a date that is the same month and day but the year will be the NEXT year.

 

Using today as an example:

Here is the auto-populated field for today's date

CourtGinger_0-1624485623543.png

And this is what it's called: 

CourtGinger_1-1624485665027.png

I need a field that will populate the date to Jun 23, 2022 automatically (based off the other date).

Hope that made sense.

 

Is this possible? 

TOPICS
Edit and convert PDFs , General troubleshooting , JavaScript , PDF forms

Views

3.5K

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 , Jun 24, 2021 Jun 24, 2021

A better solution is to use the built-in methods of the Date object to do it, which will take care of the Feb 29th issue without having to hard-code each leap year into it:

 

var sDate = this.getField("Cur_Date").valueAsString;
if (sDate) {
	var cDate = util.scand("mmm dd, yyyy", sDate);
	cDate.setFullYear(cDate.getFullYear()+1);
	event.value = util.printd("mmm dd, yyyy", cDate);
} else event.value = "";

Votes

Translate

Translate
Community Expert ,
Jul 07, 2021 Jul 07, 2021

Copy link to clipboard

Copied

Most (maybe all) scripts will stop working when the file is converted to Adobe Sign.

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 ,
Jul 08, 2021 Jul 08, 2021

Copy link to clipboard

Copied

Oh good to know, thank you.

 

Is there any way around that?

 

The script that autopopulates today's date seems to work. It's weird that the other one doesn't

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 Expert ,
Jul 08, 2021 Jul 08, 2021

Copy link to clipboard

Copied

> Is there any way around that?

 

Don't use Adobe Sign.

Or use only features supported by Adobe Sign.

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 ,
Jul 08, 2021 Jul 08, 2021

Copy link to clipboard

Copied

LATEST

Ok thank you

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