I know this question has been asked on SO before, but I can’t figure out what I’m missing. Here is a simple Fiddle.
The jquery:
var myDate = new Date(1978,2,11)
$('#datepicker').datepicker('setDate', myDate);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have to initialize the datepicker first:
When you pass setDate, you are calling a method which assumes the datepicker has already been initialized on that object.
http://jsfiddle.net/tbYPf/4/