Good Morning, I'd like to control dynamically the maxDate of my datepicker. For examp. : I have a date on my form on a textbox with value 20/12/12.
I tried this but is not working, the calendar is disabling the maxDate from the date i got on my textbox. Can you please help me with this:
$(function() {
var date = new Date();
var m = date.getMonth(), d = date.getDate(), y = date.getFullYear();
$("#Panel2nrFecha").datepicker({
minDate: new Date(y, m, d),
maxDate: $("#Panel2nrTextBox1").val(),
dateFormat: "dd/mm/y",
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 3
});
});
After you have initialized your datepicker, you can change the maxDate
option like this:
$("#Panel2nrFecha").datepicker('option', 'maxDate', $("#Panel2nrTextBox1").val() );
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