Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

date field auto fill text boxes

Pennypacker
Level 1
Level 1

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
1 Accepted Solution
radzmar
Correct answer by
Level 10
Level 10

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

View solution in original post

1 Reply
radzmar
Correct answer by
Level 10
Level 10

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

View solution in original post