I have an input field that I define as a datepicker through a css class. I now want to clone this input field and have it so the cloned inputs are also datepickers.
to bad I can't comment anymore on the answer given above, but the code still fales! The datepicker shows up at the cloned input element , but uses the selected date value in the original input field and leaves the cloned input field blank .. Any suggestions?
edit:
Using the following code fixed it for me..
$('.datum',clone).removeClass("hasDatepicker").attr('id',"").datepicker();
( note that I have cloned a wrapper , and am only targeting the 'datum' input field in that wrapper )
After removing the class as suggested above , I also remove id of the cloned input element. It's the same as the original, so that's why I was updating the original input field with the selected date in the datepicker box.