Quantcast
Channel: Tutorials Archives | Gravity Wiz
Viewing all articles
Browse latest Browse all 122

Add Weekend/Weekday-based Conditional Logic with Gravity Forms

$
0
0

This article requires the GP Conditional Logic Dates perk. Buy Gravity Perks today to get this perk plus 23 other galatic Gravity Forms plugins!

Conditional logic is one of the many powerful features provided by Gravity Forms. Our powerful GP Conditional Logic Dates perk extends upon this functionality to allow you to create date-based conditional logic.

In this tutorial, we will demonstrate how to use GP Conditional Logic Dates to setup conditional logic based on whether the date entered (or populated) into a Date field is a weekend or weekday.

Steps

  1. Add a Date field
  2. Add two Drop Down fields
  3. Setup Conditional Logic for Weekday Options
  4. Setup Conditional Logic for Weekend Options

1. Add a Date field

First, we’ll add a Date field to our form. The Date field will be used to determine which Drop Down field we display depending on the day of the week.

gf-day-based-conditional-logic-date

2. Add two Drop Down fields

Next, we’ll add two Drop Down fields to our form. One will be for our weekday options and the other will be for our weekend options.

You can apply this functionality to any fields, notifications, confirmations or feeds. We’re simply using Drop Down fields as a demonstration.

3. Setup Conditional Logic for Weekday Options (using GP Conditional Logic Dates).

First things first, make sure that you install and activate GP Conditional Logic Dates.

Next, follow these steps to configure the “Weekday Options” Drop Down field:

  1. Open the field settings for the “Weekday Options” Drop Down field and navigate to the “Advanced” tab.
  2. Check the “Enable Conditional Logic” checkbox option
  3. Select “Any” from the drop down that contains the options “Any” and “All”.
  4. Select your Date field from the first drop down.
  5. Select “is” from the second drop down.
  6. Enter {monday} in the third input.
  7. Add a new rule by clicking the (+) button at the end of the row and follow steps 4 and 5 again.
  8. Enter {tuesday} for the third input on the new condition.
  9. Repeat the previous steps for the 3 remaining days of the week: {wednesday}, {thursday} and {friday}

Once configured, your conditional logic should match the settings below.

gf-weekday-conditional-logic-dates

4. Setup Conditional Logic for Weekend Options (using GP Conditional Logic Dates).

Next, we will follow steps 1-7 from above for the “Weekend Options” Drop Down field; however this time we will use the {saturday} and {sunday} merge tags.

gf-weekend-conditional-logic-dates

That’s it! Now when a user visits your site and selects a date, they will see either a Weekday Options drop down or a Weekend Options dropdown.

What questions do you still have?

Do you still have any questions about how to get this setup? We’d love to know what they are. Let us know!


Viewing all articles
Browse latest Browse all 122

Trending Articles