I have the following two DatePickers that I use in ASP.Net
WebForm. I want to disable dates from the second DatePicker that were in the past than the date selected in the first DatePicker.
<script type="text/javascript">
$(document).ready(function () {
$("#FromDate").datepicker({
autoclose: true,
format: 'MM/dd/yyyy',
todayHighlight: true,
clearBtn: true,
orientation: 'bottom'
});
});
</script>
<script type="text/javascript">
$(document).ready(function () {
$("#ToDate").datepicker({
autoclose: true,
format: 'MM/dd/yyyy',
todayHighlight: true,
clearBtn: true,
orientation: 'bottom'
});
});
</script>
And the .aspx code:
<tr>
<td class="auto-style1">
From Date:
</td>
<td rowspan="2" class="auto-style1">
<div class="form-group">
<%--<label for="usr">FromDate:</label> --%>
<div class='input-group date' id='FromDate'>
<asp:TextBox ID="TextBoxFromDate" runat="server" CssClass="form-control"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group">
<%--<label for="usr">ToDate:</label>--%>
<div class="input-group date" id="ToDate">
<asp:TextBox ID="TextBoxToDate" runat="server" CssClass="form-control"></asp:TextBox>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</td>
</tr>
What to do?
user8930129
source
share