Gravity Form Date Field Filter

When you use “Gravity form date field” and want a user to select future dates or today’s date only, simply add one Html field and copy paste below code snippet to HTML field. This will be applied to all date fields in gravity form.
<script >
gform.addFilter( 'gform_datepicker_options_pre_init', function( optionsObj, formId, fieldId ) {
// do stuff
optionsObj.minDate = new Date();
return optionsObj;

Leave a comment

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