Skip to content

Commit b8c391f

Browse files
authored
gpld-default-to-min-date.js: Migrated from experimental folder.
1 parent 56e6249 commit b8c391f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Gravity Perks // GP Limit Dates // Default value to the minimum date allowed
3+
* https://gravitywiz.com/documentation/gravity-forms-limit-dates/
4+
*
5+
* Experimental Snippet 🧪
6+
*
7+
* Instructions:
8+
* 1. Install our free Custom Javascript for Gravity Forms plugin.
9+
* Download the plugin here: https://gravitywiz.com/gravity-forms-code-chest/
10+
* 2. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin.
11+
* 3. Update `formId` variable accordingly
12+
*/
13+
var fieldId = 5;
14+
15+
/* Not ideal to use the setTimeout, but it helps make sure the datepicker is ready to go. */
16+
setTimeout( function () {
17+
jQuery( '#input_GFFORMID_' + fieldId )
18+
.val( GPLimitDates.getDateValue( '', 'minDate', fieldId, GFFORMID, GPLimitDatesDataGFFORMID ) )
19+
.change();
20+
} );

0 commit comments

Comments
 (0)