The goal is for the Acrobat form to fill in the date field ("MeetingDate") with the date "Today" when the user opens it. If the user saves the form as is and opens it after a few days, the old date should still be there, and not replaced by the current date. If the user changes the date in the field, this date should be saved and should not be replaced when the form is opened later.
I have a custom Script calculation for a date field ("MeetingDate") that does all of this, but with one problem:
if (event.value != "")
then
event.value = util.printd ("m/d/yyyy", new Date())
endif
This works well, except that after entering the script, today the date fills in the MeetingDate field and the value is saved. This makes sense, but I want the field to be automatically populated with the date "Today" when the user opens the form. Instead, if the user opens the form tomorrow (7/16/2010), it will have 7/15/2010 in the field, because this is the date I saved the form.
I think the answer may be to introduce Script as a JavaScript document (Advanced | Document Process | Document JavaScripts), as document scripts are executed when the form is opened, but all my attempts cause the date entered by the user to be overwritten when the form open a few days later. Thanks for the help!