Autofill today's date using a dropdown menu
I am typing up a form where, when a name is selected from a dropdown menu list in one field named "Name", the field directly below it autopopulates with the date (the field is named "Date". This document will have several sections with these two fields, so when different parts of the form are filled out, the reader will know who filled it out and on what day. Currently, I have this written out under the calculations tab for "Date":
var D = this.getField("Name").valueAsString;
if (D=="Donald") event.value = util.printd("mm/dd/yyyy",new Date);
var K = this.getField("Name").valueAsString;
if (K=="Karin") event.value = util.printd("mm/dd/yyyy",new Date);
var T = this.getField("Name").valueAsString;
if (T=="Tom") event.value = util.printd("mm/dd/yyyy",new Date);
This seemed to work, leaving the "Date" fields filled with the current date when a name was selected. However, the next day, when the next dropdown menu was filled out, all previous dates updated to match the new date. Is there any way to prevent this?
