Expand my Community achievements bar.

date

Avatar

Level 2

how to display only today's  date

ex:from calander user should pick that day date(if today is june 2nd calander marker should pick only today'sdate)

2 Replies

Avatar

Level 4

How about if you make it even easier on the user and just put the following FormCalc script in the Layout:Ready event:

$.rawValue = num2date(Date(), "MM/DD/YYYY")

Also, if you set it to Protected, they will not be able to pick a different date.

Jo

Avatar

Level 9

Hi,

But if you do not validate the field it will show the current date even if you have saved the form fewdays ago.

So in the docReady event write the script whether the datefield has any previous value or not ? If it has not any value then set it to the current date.

if (this.rawValue != null )then

     this.rawValue = num2date(Date(), "MM/DD/YYYY")

else

     this.rawValue = this.rawValue;

endif.

Thanks,

Bibhu.