Fields that auto calculate date based on user input date.
I have a form that requires 7 day history from date of application. The user inputs the application date. I then have 7 separate fields that should auto calculate the past 7 days from the user input. For example: user input = 06/07/2018
| Prior 7 | Prior 6 | Prior 5 | Prior 4 | Prior 3 | Prior 2 | Prior 1 |
|---|---|---|---|---|---|---|
| 05/31/2018 | 06/01/2018 | 06/02/2018 | 06/03/2018 | 06/04/2018 | 06/05/2018 | 06/06/2018 |
With the dates in the table above being auto-calculated in 7 separate fields. Let me know if I'm not making any sense. Also, here's something that I found to try and adapt to what I need, but my coding knowledge is small and not in Java at all haha so any help is appreciated.
var dateString = this.getField("Date of Application").value;
if (dateString=="") event.value = "";
else {
var d = util.scand("mm/dd/yyyy", dateString);
d.setDate(d.getDate()-7);
event.value = util.printd("mm/dd/yyyy", d);
}
Thanks.
