Description
Do something after the maximum date has been set for a Date field.
Usage
gform.addAction( 'gpld_after_set_max_date', 'my_custom_function' );
Parameters
input jQuery
The current Date input.
date Date
The maximum date that was set.
selectedDate Date
The date selected in another Date field on which the current Date field’s maximum date is dependent.
fieldId int
The ID of the current Date field.
formId int
The ID of the current form.
data object
All Limit Dates data for the current form.
Since
This action is available since Gravity Forms Limit Dates 1.1.4.
Examples
Populate the new maximum date into the field.
When Field B’s maximum date is dependent on the selected date in Field A, automatically populate the maximum date into Field B.
if( window.gform ) {
gform.addAction( 'gpld_after_set_max_date', function( $input, date ) {
$input.datepicker( 'setDate', date );
} );
}
Automatically show datepicker for linked Date field.
When a date selected in Field A modifies the maximum date in Field B, automatically open the datepicker in Field B after the date has been selected in Field A.
if( window.gform ) {
gform.addAction( 'gpld_after_set_max_date', function( $input, date ) {
$input.datepicker( 'show' );
} );
}