I am facing an issue with some ajax calendar extenders. I have two similar calendars and two textboxes, each linked to one calendar.
<asp:TextBox ID="txt1" runat="server"</asp:TextBox>
<cc1:CalendarExtender ID="calendar1" runat="server" TargetControlID="txt1"
Format="yyyy-MM-dd" CssClass="Calendars" Enabled="false">
My challenge is that when I select a date in the first calendar, I want the second calendar to show the same month as the first one without selecting the actual date (as it will display in txt2 textbox). The txt2 should stay empty until the user selects a date in calendar2.
I have searched everywhere online but haven't found a solution that fits my specific situation.
Could someone provide assistance?
EDIT:
I attempted changing the date and then clearing the textbox using JavaScript, but I encountered an issue with a compare validator triggering. Below is the JavaScript code used for clearing the textbox:
function onShowingCal2(sender, e) {
var txt2 = document.getElementById('<%= txt2.ClientID %>');
var txt1 = document.getElementById('<%= txt1.ClientID %>');
var cal2 = sender;
if (txt2.value == "") {
var dateStart = new Date();
dateStart.setDate(txt1.value);
cal2.set_selectedDate(dateStart );
datechosen = false;
}
}
function onTextboxChange() {
if (!datechosen ) {
document.getElementById('<%= txt2.ClientID %>').value = "";
}
}
Thank you!