I have a form with cloned fields using clone, changing the name and ID to add an incremented value to these attributes for each field on each clone, then using appendTo to add the row of fields. This works just fine by itself.
The problem is that one of these fields is a datepicker field. It works for the first (original) set of fields, but not for any of the appended clones.
If I manually create multiple fields, #datepicker1, #datepicker2, etc, this works as expected for all the fields.
I am presuming that this is because the datepicker-initialization function is in the original HTML, and in some way is not "registered" to listen for the appended fields, as they don't yet exist. So how would I use this for each set of cloned and appended fields?