- I have a button and when I click on the button I want to reload my DatePicker accordingly and launch the beforeShowDay event of the datePicker from my click event.
How can I do that? -
How to set the DatePicker date to the ListDate[0] date?
var ListDate = new Array(); var ID; $(function () { $("#myDateDiv").datepicker({ showOtherMonths: true, selectOtherMonths: true, dateFormat: "yy/mm/dd", onSelect: function (dateText, inst) { // }, onChangeMonthYear: function(year, month, inst) { }, beforeShowDay: function(dateToShow) { testFunction(dateToShow, ID); ListDate = getListdateFuction(); ///How to set the datePicker date to ListDate[0] }); }); });
$("test").click(function(){ How to call datePicker berforeShowDay or onChange function ??? });
I have a button and when I click on the button I want to
Share
if you want to set the date use setDate
the onChangeMonthYear will be triggered when you you change the month see WORKING DEMO