I have the following javascript in a form I am creating in LiveCycle. The first item, setting the ReportDate works fine. The second item does not. It puts eeee in the field, and not the weekday's name. I even tried using "eee" and "EEEE" and "EEE" to only get the "e" characters placed in the field as they are listed. What might I have wrong?
form1.#pageSet[0].Page1.SaveAsButton::click - (JavaScript, client)
// Place the current Date and Day in the appropriate fields on the form
Page1Header.ReportDate = util.printd("mm/dd/yyyy", new Date());
Page1Header.ReportDay = util.printd("eeee", new Date());
Regards,
Karl
Solved! Go to Solution.
Views
Replies
Total Likes
You are mixing JavaScript with FormCalc keywords.
EEEE- is a FormCalc keyword to get the Weekday.
In java Script, you can get the Weekdays in numbers.
So you have to write code to get the matching spelled out name for the weekday.
Try something like this..
var d=new Date();
var weekday=new Array(7);
weekday[0]="Sunday";
weekday[1]="Monday";
weekday[2]="Tuesday";
weekday[3]="Wednesday";
weekday[4]="Thursday";
weekday[5]="Friday";
weekday[6]="Saturday";
xfa.host.messageBox("Today is " + weekday[d.getDay()]);
Page1Header.ReportDay.rawValue = weekday[d.getDay()];
Thanks
Srini
Views
Replies
Total Likes
You are mixing JavaScript with FormCalc keywords.
EEEE- is a FormCalc keyword to get the Weekday.
In java Script, you can get the Weekdays in numbers.
So you have to write code to get the matching spelled out name for the weekday.
Try something like this..
var d=new Date();
var weekday=new Array(7);
weekday[0]="Sunday";
weekday[1]="Monday";
weekday[2]="Tuesday";
weekday[3]="Wednesday";
weekday[4]="Thursday";
weekday[5]="Friday";
weekday[6]="Saturday";
xfa.host.messageBox("Today is " + weekday[d.getDay()]);
Page1Header.ReportDay.rawValue = weekday[d.getDay()];
Thanks
Srini
Views
Replies
Total Likes
Works! Thank you very much!
Views
Replies
Total Likes
Views
Likes
Replies