Created
November 4, 2021 15:41
-
-
Save wgroenewold/dab8481399e48c1d965e4cc1910a2edb to your computer and use it in GitHub Desktop.
Reinit datepicker fields in Gravity Forms when used in repeater
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on("click", ".gfield_repeater_buttons button", function(){ | |
$('.datepicker').each(function(){ | |
$(this).datepicker({ | |
yearRange: '-100:+20', | |
showOn: 'focus', | |
dateFormat: 'dd-mm-yyyy', | |
changeMonth: true, | |
changeYear: true, | |
suppressDatePicker: false, | |
}); | |
}); | |
}); | |
//enqueue with add_action( "gform_enqueue_scripts", array( $this, "gf_enqueue_assets" ), 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment