I am a novice when It comes to scripts, but I can figure it out with no problem in Acrobat XI and DC Pro but I am having a problem with it in LiveCycle.
In my Adobe XI document I have a filed named Date.
For the Date field, it has a simple calculation script to display today's date in the dd/mm/yy format (IE 22/02/17):
var today = new Date();
event.value = util.printd("dd/mm/yy", today);
Then I have a custom format script to take the value from the calculation script and format it to display as 22ND DAY OF FEBRUARY, 2017
if (event.value) {
var d = util.scand("dd/mm/yy", event.value);
if (d!=null) {
event.value = getCustomDateString(d);
}
}
function getCustomDateString(d) {
var ordinalSuffix;
if (d.getDate()==1 || d.getDate()==21 || d.getDate()==31)
ordinalSuffix = "st";
else if (d.getDate()==2 || d.getDate()==22)
ordinalSuffix = "nd";
else if (d.getDate()==3)
ordinalSuffix = "rd";
else
ordinalSuffix = "th";
return util.printd("D'"+ordinalSuffix+" DAY OF' MMMM, YYYY", d, true);
}
event.value = event.value.toUpperCase();
I imported this PDF file into LiveCycle Designer ES4 and I get a notice that the Java from the document has been commented out...
How would I get the above field that works in Adobe XI Pro to do the same thing in LiveCycle? We want to try our documents in LiveCycle because of the ability to make the documents dynamic and flowable.
Any help would be greatly appreciated.
I have a couple more instance where this is happening but I figured this was the easiest one a veteran would be able to help me with.
Thanks!
