Hmm... well.. you have this declared
dateFormat: "dd MM yy" and you say you want to set it to 10 Mar 2008 The format is looking for a 2-digit year, your value is a 4 digit year, i'd say that would be an issue and could be the cause of your unexpected result also, what about simply setting the value of the textbox if fixing the format/value mixup doesn't work $("#start").val("10 Mar 2008"); On Jan 14, 11:00 am, "graphic...@googlemail.com" <graphic...@googlemail.com> wrote: > Sorry the error was in my post but not in my code. So yes it should > be > > $("#start").datepicker("setDate", "10 Mar 2008"); > > but that gives me non-sense date as mentioned in my first post. Any > idea ? > > On 14 jan, 14:31, MorningZ <morni...@gmail.com> wrote: > > > Well, that second selector is wrong to start with... shouldn't it be $ > > ("#start") and not $(start) ? > > > On Jan 14, 9:24 am, "graphic...@googlemail.com" > > > <graphic...@googlemail.com> wrote: > > > Hi, > > > > This setDate is driving me mad ! I can't set the date of the controls > > > programatically. > > > > //create range datepickers > > > $("#start , #end").datepicker({ > > > showOn: "button", > > > buttonImage: "images/calendar.gif", > > > buttonImageOnly: true, > > > beforeShow: customRange, > > > hideIfNoPrevNext: true, > > > showStatus: true, > > > duration: "", > > > dateFormat: "dd MM yy" > > > }).attr("readonly", "readonly"); > > > > $(start).datepicker("setDate", "10 Mar 2008"); > > > > displays non-sense date such as 14 august 2014.... > > > > Is there something I'm doing wrong ? > > > > Thanks