Skip navigation
yashpancholi
Currently Being Moderated

How to create a Date or time field that automatically saves current date or time?

Mar 27, 2012 11:10 AM

hello,

i want to know that how to create a Date/Time field that automatically shows current Date/Time when .pdf form is opened.

also want to how to stop user to give input in Date/Time field

currently im putting a Date field but it is accepting user input.

hoping for quick response

 

Thanks in advance!

 
Replies
  • Currently Being Moderated
    Mar 27, 2012 9:19 PM   in reply to yashpancholi

    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"));

    endif

     

    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.

     

    Thanks

    Srini

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 29, 2012 7:49 AM   in reply to yashpancholi

    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.

     

    Thanks

    Srini

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 30, 2012 7:38 AM   in reply to yashpancholi

    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.

     

    Thanks

    Srini

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points