Populate the New Minimum Date into Linked Date Field

When Field B’s minimum date is dependent on the selected date in Field A, automatically populate the minimum date into Field B.

Instructions

  1. Install this snippet with our free Custom JavaScript plugin. https://gravitywiz.com/gravity-forms-code-chest/

Code

Filename: gpld-populate-new-minimum-date-into-linked-date-field.js

/**
 * Gravity Perks // Limit Dates // Populate the New Minimum Date into Linked Date Field
 * https://gravitywiz.com/documentation/gravity-forms-limit-dates/
 *
 * When Field B's minimum date is dependent on the selected date in Field A,
 * automatically populate the minimum date into Field B.
 *
 * Instructions:
 *
 * 1. Install this snippet with our free Custom JavaScript plugin.
 *    https://gravitywiz.com/gravity-forms-code-chest/
 */
 gform.addAction( 'gpld_after_set_min_date', function( $input, date ) {
 	$input.datepicker( 'setDate', date );
} );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.