Hi Collectiv,
It's been a while back since I did this, but what I ended up doing was adding a script like this:
jQuery(document).ready(function($) {
$('.gfield_list_51_cell1 input').addClass('datepicker mdy');
$.aop.after( {target: window, method: 'gformAddListItem'}, function(result) {
//Destroy the previous datepicker classes that were mucking this up
$('.datepicker').removeClass('hasDatepicker');
$('.datepicker').datepicker('destroy');
//Call the datepicker function to re-add date pickers
gformInitDatepicker();
return result;
} );
});
That bit of code relies on aop.min.js, which you can find here: https://code.google.com/p/jquery-aop/source/browse/bin/aop.min.js?r=d1052368b0769afe20f6b09bdc371acf6f2246a6
And I edited the gravityforms.js file at line 563 -- this is an old version now, but it is inside the gformAddListItem function:
var new_id;
var randomNum;
clone.find(".datepicker").each(
function() {
randomNum = Math.floor(Math.random()*11);
new_id = new Date().getTime() + randomNum;
jQuery(this).attr("id", new_id);
}
);
If this doesn't work for you it might be out of date, but let me know and I'll try to help! I know it took me some time to get it working so hopefully this will help you out. You'll have to be careful when updating your GF version to put the edits back in.
Posted 11 years ago on Friday March 22, 2013 |
Permalink