J.Pip J.Pip - 2 years ago 158
Javascript Question

jquery UI datepicker reset date

I have a datepicker that's on an input field,

default date when I first open it is today's date, which is what I want.

However when I select a date and I clear the input field,

the datepicker still has the selected date on it, which I don't want :p

Does anyone has an idea why this happens and how I can prevent this behaviour?



Answer Source

See http://codepen.io/alexgill/pen/yOQrwV

$(SELECTOR).datepicker('setDate', null);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download