You can place the below code in the initialize event of the field to display the current date and time.
Set the language to FormCalc.
You can play around the formats to get the desired format of date and time.
if($.rawValue eq null or $.rawValue eq "") then
$.rawValue = Concat(Num2Date(Date(), "MM/DD/YYYY")," ", Num2Time(Time(), "h:MM:SS A"));
You can not restrict the input area in Date time field instead you can validate the input while existing the field.
(OR) set the field to either readOnly or protected mode.
but the problem is when i edit half filled form
it keeps the date and time when first it was filled!
i want it to save the date/time when it was last time saved/edited.
Every time you save the form, assign the current date and time again to the same field.
That way it will retain the last saved date and time.
how to assign current date/time when the field is already filled with earlier date/time?
please let me know step by step instructions!
In your Save/ Submit button click event, place the following code to populate the date and time..
Use FormCalc as the language..
DateTimeField1.rawValue = Concat(Num2Date(Date(), "MM/DD/YYYY")," ", Num2Time(Time(), "h:MM:SS A"));
You can use rawValue property of the field to assign value at any time.