Datepicker

Datepicker


Hi,
I use datepicker with month and year in dropdowns, and year dropdown
with range 1900 to 2009. The date format is dd-mm-yy. In the first
page i saved the picked date in database. In the next page i want to
populate the date from the database to my jquery datapicker in that
page, where i failed to do so. Instead of populating the saved date, i
am getting the current date populated in the datapicker textbox.
$(function() {
$('#datepicker').datepicker({
changeMonth: true,
changeYear: true
});
$('#datepicker').datepicker({ yearRange: '1900:2009' });
$('#datepicker').datepicker('option', 'yearRange', '1900:2009');
$('#datepicker').datepicker({ dateFormat: 'dd-mm-yy' });
$('#datepicker').datepicker('option', 'dateFormat', 'dd-mm-yy');
});
if i remove "year range" and date format script parts from the above
function, it works fine.
Any help would be appreciated..
Thanks..