- Install GP Limit Dates.
- Add two Date fields to your form.
- Set “Minimum Date” on second Date field.
- (optional) Configure “Maximum Date” on first Date field.
1. Install GP Limit Dates (via Gravity Perks)
2. Add two Date fields to your form.
Under the Advanced Fields field group, click the “Date” field button to add a Date field. After the first has been added, click the button again to add a second.
You should now have two Date fields on your form. I’ve named mine “Start Date” and “End Date”.
3. Set “Minimum Date” on second Date field.
Click on the second Date field to open the field settings. Navigate to the “Perks” tab.
Set the “Minimum Date” setting to the “Start Field”.
That’s it! Whenever a date is selected in the Start Date field, the minimum date in the End Date field will be adjusted based on the selected date.
In some cases, you may want to enforce a minimum range between the start and end dates. You can use the “Date Modifier” input (next to the “Minimum Date” select) to modify the selected date before it is set as the minimum date.
For example, if you would like to enforce a two-night stay at your hotel, you could increase the selected date by
+2 days. This means if the first date selected was Jan 13, 2015 the minimum date in the second field would be Jan 15, 2015.
For more information on modifying dates, read the GP Limit Dates documentation.
4. (optional) Configure “Maximum Date” on first Date field.
If you’d like, you can take this a step further and set the “Maximum Date” on the first Date field to the selected date from the second Date field. This can help a user fully understand the connection between the two Date fields.