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

date field auto fill text boxes

Avatar

Avatar
Level 1
Pennypacker
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
Pennypacker
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
Pennypacker
Level 1

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)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
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)