I would like to trigger an event in jquery datepicker ,but when i select a particular date ,its not been triggered.
This is my code for validation of the from date and to date, what should I do to make this function active?
$("#fromDate").datepicker({
numberOfMonths: 1,
onselect: function (selected) {
alert("hello");
var dt = new Date(selected);
dt.setDate(dt.getDate() + 1);
$("#toDate").datepicker("option", "minDate", dt);
}
});
$("#toDate").datepicker({
numberOfMonths: 1,
onselect: function (selected) {
var dt = new Date(selected);
dt.setDate(dt.getDate() - 1);
$("#fromDate").datepicker("option", "maxDate", dt);
}
});
You have to write the function properly. It's onSelect, with an uppercase 'S'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With