Date field populates depending on when form opens

Avatar

Avatar

stephenf8734174

Avatar

stephenf8734174

stephenf8734174

22-12-2016

Hi - I have a form to be submitted that includes a list of subjects for a particular meeting that happens each Monday. Can a date field populate with the date of that Monday when the form opens in the preceeding week? And then happen each week after that?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Mark_Lindberg

Avatar

Mark_Lindberg

Mark_Lindberg

18-01-2017

Are you generating a new form each week?

If so, this will get the date for next Monday - you can play with the format:

var d = new Date();

d.setDate(d.getDate() + (1 + 7 - d.getDay()) % 7);

this.rawValue = d;

If you are using the same form for multiple weeks, then you would need to test to see if the current field value was less that the value generated by the script and replace in the field if needed.

Good Luck,

Answers (0)