Skip to main content
Inspiring
December 17, 2024
Question

Auto populate future date

  • December 17, 2024
  • 1 reply
  • 306 views

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?

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
December 17, 2024

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);

 

Inspiring
December 18, 2024

BLESS YOU

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