I have a function that imports information into a form. I am using jQuery to place a date into an input box. The ID of the input box is "depart_date" and I am trying to insert the value of (let's say) 04/01/2012.
$('input#depart_date').replaceWith('<input class="input_med hasDatepicker" type="text" id="depart_date" name="depart_date" value="04/01/2012">');
This works just fine. However, I lose my datepicker. I have even tried to "reinitialize" it by using
$( "#depart_date" ).datepicker({ minDate: 0});
I just don't understand how to get my datepicker back.