How to Auto Populate a Date Two Weeks From A Set Start Date
Hello,
I am currently trying to create a pdf that requires a few date boxes. I have a date box that automatically populates with the date when someone opens the form, but I need to make another box that calculates the date 2 weeks from the first date entered and then auto populate it onto the form. I have tried several versions of code and cannot seem to get any of them to work for me. Below is what I have been using and it doesn't come back with any errors but nothing actually auto populates on the pdf form when it opens so the script doesn't seem to be working. Please advise!
var startDate = this.getField("Today").value;
// Convert start date string to a Date object
var startDateObj = util.scand("mm/dd/yyyy", startDate);
// Calculate future date by adding 14 days
var futureDateObj = new Date(startDateObj.getTime());
futureDateObj.setDate(futureDateObj.getDate() + 14);
// Format future date as "YYYY-MM-DD" string
var futureDateString = util.printd("mm/dd/yyyy", futureDateObj);
