I have two datepickers named startdate and enddate. I want to disable all other dates except the selected date from startdate. for example if i selected 15/12/2016 from startdate datepicker then i want to disable all other dates in enddate datepicker except 15th day.
Demofiddle : https://jsfiddle.net/d7vzxn8s/
This is my code :
<p>Start Date: <input type="text" id="startdate"></p>
<p>End Date: <input type="text" id="enddate"></p>
<script>
$("#startdate").datepicker({
onSelect: function (selected) {
var dt = new Date(selected);
dt.setDate(dt.getDate());
$("#enddate").datepicker("option", "minDate", dt);
}
});
$("#enddate").datepicker();