Date Based Conditional Logic adds support for conditional logic based on selected dates, the current date, relative dates, and more in Date fields.
- Show or hide fields based on user-input date
- Show or hide fields based on the current date, when a user is filling out the form, or relative dates.
- Special merge tags give you flexible options to precisely trigger conditional logic.
Granular settings for conditionally displaying which fields and options display on your forms.
- Provide different prices or product options based on when a user is filling out the form.
- Automatically adjust seasonal pricing.
- Show an alert message for weekend submissions.
Features
- Show and hide fields based on Date field values.
Display different fields based on user input. - Supports static dates, current date, and relative dates.
Flexible conditional logic to meet your form’s unique needs. - Day of the week merge tags.
Trigger conditional logic based on weekdays, weekends, or any combination. - Full Easy Forms integration.
Use date-based conditional logic in Confirmation Settings (Conditional Redirection or Thank You messages) or with any add-on.
Feature Details
Date-Based Logic
Date-based logic supports static dates, relative dates and days the week. This is done using three comparison operators: is, greater than, and less than. Multiple rules can be combined to match date ranges or exclude specific dates from the match.
Note: “Is Not” is a condition too, by selecting “None” (in “Type of Condition“)
Static Dates
To compare a Date field to a static date, select the Date field, choose a comparison operator, and enter the static date to compare against.
Display field if current date is after of March 04, 2022:
Note: Date values must be entered using the HTML5 date format: YYYY-MM-DD
Relative Dates
There’s two ways that relative dates are supported in Date Fields:
- Comparing a user-inputted date to a relative date.
- Comparing the current date to a static or relative date.
Today
Comparing user input to relative dates is done using the conditional-logic-only merge tag {today}
. It allows conditional logic to be applied to fields based on whether the selected date is, is greater than or is less than the current date.
Display field if selected date is today:
The {today}
merge tag supports modifiers for making date comparisons like:
- Date is at least 2 weeks away:
{today:+14}
- Date is no more than 90 days before today:
{today:-90}
Days of the Week
Use the following conditional-logic-only merge tags to check for a specific day of the week: {monday}
, {tuesday}
, {wednesday}
, {thursday}
, {friday}
, {saturday}
, {sunday}
. These are used in the same manner as the {today}
merge tag.
Weekend or Weekday
Using the days of the week merge tags, you can apply conditional logic based on whether the date falls on a weekend or weekday.
First, we’ll tackle checking for weekend dates.
- Add a new rule
- Select “Any” as Type of Condition
- Select your Date field from the first drop down.
- Select is from the second drop down.
- Enter
{saturday}
in the third input. - Add a new condition by clicking the “Add rule” button at the end of the panel and follow steps 3, 4 and 5 again.
- Enter
{sunday}
for the third input on the new condition. - Save
You can follow the same steps to check for a weekday. The only difference is: Change the Type of Condition, from “Any” to “None“.