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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Autofill dates

Avatar

Level 1

I am creating a form where I would like a section to autofill with dates.

I would like for the people who will be using this form to put a date into

one box and the next seven date automatically appear in the next seven boxes.

Example: (information is entered into box 1 and boxes 2-8 autofill)

Box 1: 09/13/10

Box 2: 09/14/10

Box 3: 09/15/10

Box 4: 09/16/10

Box 5: 09/17/10

Box 6: 09/18/10

Box 7: 09/19/10

Box 8: 09/20/10

Box 9: 09/21/10

I have tried using FormCalc to acheive this but I have not yet succeeded. Could someone help me? Any ideas are appriciated. Thanks!

1 Accepted Solution

Avatar

Correct answer by
Level 10

// form1.page1.date1::exit - (FormCalc, client)


var dayNum = Date2Num($.formattedValue,"MM/DD/YYYY")

date2.rawValue = Num2Date(dayNum+1,"MM/DD/YYYY")

date3.rawValue = Num2Date(dayNum+2,"MM/DD/YYYY")

date4.rawValue = Num2Date(dayNum+3,"MM/DD/YYYY")

date5.rawValue = Num2Date(dayNum+4,"MM/DD/YYYY")

date6.rawValue = Num2Date(dayNum+5,"MM/DD/YYYY")

date7.rawValue = Num2Date(dayNum+6,"MM/DD/YYYY")

date8.rawValue = Num2Date(dayNum+7,"MM/DD/YYYY")

where all date fields have a display pattern MM/DD/YYYY

Steve

View solution in original post

0 Replies

Avatar

Correct answer by
Level 10

// form1.page1.date1::exit - (FormCalc, client)


var dayNum = Date2Num($.formattedValue,"MM/DD/YYYY")

date2.rawValue = Num2Date(dayNum+1,"MM/DD/YYYY")

date3.rawValue = Num2Date(dayNum+2,"MM/DD/YYYY")

date4.rawValue = Num2Date(dayNum+3,"MM/DD/YYYY")

date5.rawValue = Num2Date(dayNum+4,"MM/DD/YYYY")

date6.rawValue = Num2Date(dayNum+5,"MM/DD/YYYY")

date7.rawValue = Num2Date(dayNum+6,"MM/DD/YYYY")

date8.rawValue = Num2Date(dayNum+7,"MM/DD/YYYY")

where all date fields have a display pattern MM/DD/YYYY

Steve