How to retain values in the text box in multidatepicker

How to retain values in the text box in multidatepicker

Hi, 
I used the multidatepicker from  http://multidatespickr.sourceforge.net/ in my form. It works fine. When I submit the form, I am not able to retain the value of the dates chosen. 

We generally retain the values using javascript 
document.getElementById('datepicker').value = "<?php echo $_POST['datesofdelivery'];?>";
That doesnt work with the multidatepicker. 

I tried my hand with the various options such as addDate but no luck.

Is it possible to retain date values in the text box in the multidatespicker?