- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Are you creating your form in Acrobat or LiveCycle Designer. A little hare to tell with all of your posts.
For Acrobat forms:
You can get a lot of different information from the date object by changing the format string for the 'util.printd' method. See the reference George Johnson links to for the format string values that can change the displayed value.
// get new Date object
var d = new Date();
// format to h:MM tt
var sDate = util.printd("h:MM tt", d);
// insert date into form field
this.getField("todaysDate").value = sDate;
h - hours without leading zero
MM - minutes with leading zero if necessary
tt - am or pm designator
For LiveCycle Designer you can select the 'Custom' form tab and then the 'Current Date' field. Now change the script to:
$.rawValue
= num2Time(time(), TimeFmt(1))
More information about the time format is the 'Scripting Reference' under LiveCycle Designer's 'Help' menu option.
For the field object, you can set the "Value" "Type:" option to "Calculated - Read Only". But if you use the predefined 'Current Date' field, this is already done for you.
Views
Replies
Total Likes