I know when you create an element dynamically, you have to use something like:
$(\"#id\").live(\"click\", function() { //something });
I think that more proper solution is:
$('input.datepickerClass').live('focus', function(){ if (false == $(this).hasClass('hasDatepicker')) { $(this).datepicker({ options }); } });