What's covered in this article?
What is the Date Element?
The Date Element allows users to capture the past, present or future date stored in a localized format. In the U.S., the date will appear as Month-Day-Year.
What are Dynamic Values?
How do I dynamically populate the Date Element?
To dynamically set the date of an element based on the current date, please follow the instructions below. In this example, we will show you how to add 90 days to the current date.
PLEASE NOTE: This will only work on iOS.
STEP 1. Add a Date Element to your form with a data column name of date1.
STEP 2. Under the Smart Control tab, in the Dynamic Value field, type in the following: new Date().
This tells the element to default to the current date when the record is created.
STEP 3. Create another Date Element with a data column name of date2.
STEP 4. In the Dynamic Value of the date2 element, put the following:
new Date(date1.getFullYear(), date1.getMonth(), date1.getDate() +90)
This will tell the element to add 90 days to the date in the date1 element.
STEP 5. Test the functionality on your iOS device.
iFORM TIP: In the condition value of the date1 element, put false.
This will hide the element from the user so no data can be altered.
Download this form package to use as an example.