hello,
user can select upto 3 dates and on changedate even it clicks button, but the button click is so fast that before user select upto 3 dates its fire quickly can it be little bit delay so once user select all 3 dates then its fire changedate event to click button
some time user select one date or some time two dates some time three so user must have enough time before button click thru script
<asp:TextBox ID="txtdate" runat="server" AutoCompleteType="Disabled" ></asp:TextBox>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.7.1/css/bootstrap-datepicker3.min.css" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.7.1/js/bootstrap-datepicker.min.js"></script>
<script type="text/javascript">
$(function () {
var selectedDates = [];
datePicker = $('[id*=txtdate]').datepicker({
startDate: new Date(),
minDate: 0,
multidate: true,
format: "mm/dd/yyyy",
daysOfWeekHighlighted: "5,6",
language: 'en',
daysOfWeekDisabled: [0, 6]
});
datePicker.on('changeDate', function (e) {
if (e.dates.length <= 3) {
selectedDates = e.dates;
document.getElementById("<%=Button1.ClientID %>").click();
} else {
datePicker.data('datepicker').setDates(selectedDates);
alert('You can only select 3 dates.');
}
});
});
</script>