date field auto fill text boxes

Pennypacker

04-05-2020

I have a form I am designing. Users will input a week ending date (05/09/2020), and I want this to then populate text boxes with the dates for sunday through saturday, i.e. the textbox named Sun would fill with the number 3 (for May 3), textbox named Mon would fill with the number 4 (for May 4) and so on for each day of the week.  Is there a format to accomplish this? I assume I could use the date 05/09/2020, and use a script to subtract the number of days I needed to get the right date.  

 

 

Thanks in advance

 

 

date and time field LiveCycle

Accepted Solutions (1)

Accepted Solutions (1)

radzmar

MVP

05-05-2020

Hi, 

 

with FormCalc you can easily calculate dates.

In the exit event of you date field, add a script like this

 

if ($.isNull eq 0) then
	var nDate = Date2Num($.formattedValue, "MM/DD/YYYY")
	Mon = Num2Date(nDate - 6, "EEE D")
	Tue = Num2Date(nDate - 5, "EEE D")
	Wed = Num2Date(nDate - 4, "EEE D")
        ; and so on ...
endif

Answers (0)