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

Auto populate future date

Community Beginner ,
Dec 17, 2024 Dec 17, 2024

Copy link to clipboard

Copied

This form is about to drive me insane.

 

I want the form to auto populate a date 30 days in the future from the current date when opened. How can I make this happen?

TOPICS
JavaScript

Views

75

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 ,
Dec 17, 2024 Dec 17, 2024

Copy link to clipboard

Copied

Use something like this code as a doc-level script (NOT inside a function):

 

 

var d = new Date();
d.setDate(d.getDate()+30);
this.getField("FutureDate").value = util.printd("dd/mm/yyyy", d);

 

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 ,
Dec 18, 2024 Dec 18, 2024

Copy link to clipboard

Copied

LATEST

BLESS YOU

I was very close with my code, so I guess I must be learning something?

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