Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Datepicker setDate doesn't work anymore?

can you explain me why this code :

http://jsfiddle.net/3qJx9/7/

doesn't work ?

I used to use it in order to put the current date as default when no date were loaded, but it doesn't work anymore, and I don't understand why.

Thanks !

like image 763
Willy Avatar asked Mar 02 '26 05:03

Willy


1 Answers

You can only call methods on an initialized jQuery UI widget and you forgot to initialize the datepicker:

$("#date").datepicker();
$("#date").datepicker("setDate", new Date());

Updated JSFiddle

like image 57
Daff Avatar answered Mar 05 '26 04:03

Daff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!