Jquery ui Datepicker maxDate dynamically
jquery, jquery-ui
Solution
After you have initialized your datepicker, you can change the `maxDate` option like this:
$("#Panel2nrFecha").datepicker('option', 'maxDate', $("#Panel2nrTextBox1").val() );
Problem
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 }); }); ```