Here is the javascript code that I have on the click event of a button:
----- form1.#subform[0].Button1::click: - (JavaScript, client) -------------------------------------
var fld = this.getField("TextField1");
fld.value = util.printd("yyyy/mm/dd",new Date());
When I click on the button I got the following error in the javascript debugger:
this.getField is not a function
1:XFA:form1[0]:#subform[0]:Button1[0]:click
this.getField is not a function
1:XFA:form1[0]:#subform[0]:Button1[0]:click
Please help. Thank you.
You could try:
$.formattedValue = util.printd("yyyy/mm/dd", Date.getDate());
From a previous post:
For Acrobat forms you can use the following document level JavaScirpt to imput the current date into a formatted field called "Current Date":
this.getField("CurrentDate").value = new Date();
In LiveCycle Designer one can use
Num2Date(Date());
in the calculation field to input the current date
There is more information about using JavaScript and FormCalc in LiveCycle Designer's Help menu option.
George Kaiser