I am using datepicker to select date in datalist control in asp.net. The scenario is the user selects the date for 2 textboxes and then click on the export to excel button , then the system generates the excel file with the data within the given dates.The issue is I want to restrict the user to select the date before clicking on export button, and the 2nd date selected should be greater than the first date selected using Jquery , below is the code:
<asp:Button runat="server" ID="btnExportbwDates"
Text="Export between Dates" onclick="btnExportbwDates_Click" />
<asp:TextBox runat="server" ID="txtDateRangeOne" CssClass="txtDateRangeOne"></asp:TextBox>
<asp:TextBox runat="server" ID="txtDateRangeTwo" CssClass="txtDateRangeTwo"></asp:TextBox>
<script type="text/javascript">
$(document).ready(function () {
var pickerOpts = {
dateFormat: "dd/mm/yy"
};
$(".txtDateRangeOne").datepicker(pickerOpts);
$(".txtDateRangeTwo").datepicker(pickerOpts);
});
</script>