Autopopulating Date Field
Hi,
Esteemed users of Acrobat Forms. I am looking for some help!
I am using the following Javascript to auto populate Date field. Intent is that a user when first time opens the form, this date field will be auto populated and will stay same.
var currentTime = new Date();
var month – currentTime.getMonth() + 1;
var day = currentTime.getDate();
var year = currentTime.getFullYear();
var rTime = day + “/” + month + “/” + year;
this.getField(“DateReceived”).value = rTime;
I tried all the following three options for entering Javascript (one at a time) and in all cases I am getting the same error message: “Error: SyntaxError: Illegal character at line 3.”
- Action > Mouse Up > Run Java Script
- Action: Mouse Up > Execute Menu | Validate > Run Custom Validation Script
- Action: Mouse Up > Execute Menu | Calculate > Custom Calculation Script
Since I am not a Java programmer, I was wondering if somebody could please help resolve this?
