<div>
<input name="StartDate" id="StartDate" type="text" readOnly="readonly" data-val-required="The From field is required." data-val="true" jQuery15106987620498322786="53"/>
<input name="EndDate" id="EndDate" type="text" readOnly="readonly" data-val-required="The To field is required." data-val="true" jQuery15106987620498322786="54"/>
</div>
$(function () {
var dates = $("#StartDate, #EndDate").datepicker({
defaultDate: "+1w",
changeMonth: true,
changeYear: true,
numberOfMonths: 1,
minDate:0,
dateFormat: 'dd/mm/yy',
onSelect: function (selectedDate) {
var option = this.id == "StartDate" ? "minDate" : "maxDate",
instance = $(this).data("datepicker"),
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings);
dates.not(this).datepicker("option", option, date);
}
});
});