I have a div in which there is a datepicker. I use something like this to clone it:
mydiv = $(\'#someDiv\');
// works fine so far
mydiv.find(\'input.datefie
$('input.datefield').datepicker("destroy");
$('input.datefield').datepicker();
it works good. But just doing this, datepicker will open on cloned input and set the date to the original input (because they have the same ID)
to solve this you must change id attribute of the cloned input.
dp = < cloned input >
var d = $('input.vDateField');
dp.removeClass('hasDatepicker');
dp.attr('id', dp.attr('id')+d.length);
d.datepicker("destroy");
d.datepicker();
and it will work great!