Problems Auto-populating Date On Page Opening
I am having problems auto-populating individual day, month and year fields of my form when the form is being opened.
When I open the form, I am getting these errors:
"Invalid date/time: Please ensure that the date/time exists. [Day] should match format d"
"Invalid date/time: Please ensure that the date/time exists. [Month] should match format mmm"
I have in my forms, fields named "Day", "Month", and "Year". They are all of a date format, with a custom format for "Day" being d, and for "Month" mmm and for "Year" yyyy. All three are set as "Read Only" and "Required"
I put this JavaScript event in the ACTIONS tab of the PAGE PROPERTIES of the page with the fields I am trying to populate.
var fd = this.getField("Day");
fd.value = util.printd("d", new Date());
var fm = this.getField("Month");
fm.value = util.printd("mmm", new Date());
var fy = this.getField("Year");
fy.value = util.printd("yyyy", new Date());The properties in the EVENTS tab are:
Select trigger: Page Open
Select action: Run a JavaScript
I save the document, and when I run, I get the errors. When I go back to the Page Properties to check the event, the select action had changed to "Execute a menu item". I can't seem to keep "Run a JavaScript" as the preferred parameter.
The action box does reflect run a JS on page open.
Where am I going wrong?
