I have two date pickers and I want to set the second one's date when the user chooses a date in the first one. I have found that if I use the getSelectedDate() method on the first date picker, then the user cannot select a date from the calendar. It just doesn't change. They can still change the date with the keyboard.
The first datepicker looks like:
Code: HTML/ASPX
<eo:DatePicker ID="Common_Proposed_Eff_DateDatePicker" runat="server" ControlSkinID="None" CssBlock="" Width="90px"
DayCellHeight="15" DayCellWidth="31" DayHeaderFormat="Short" DisabledDates="" ClientSideOnChange="Common_Proposed_Eff_Date"
OtherMonthDayVisible="True" SelectedDates="" TitleFormat="MMMM, yyyy"
TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
TitleRightArrowImageUrl="DefaultSubMenuIcon" selecteddatestring='<%# Bind("Common_Proposed_Eff_Date") %>' MinValidDate="1900-01-01" MaxValidDate="2079-06-06" >
<TodayStyle CssClass="DatePicker5" />
<SelectedDayStyle CssClass="DatePicker8" />
<DisabledDayStyle CssClass="DatePicker6" />
<FooterTemplate>
<table border="0" cellPadding="0" cellspacing="5"
style="font-size: 11px; font-family: Verdana">
<tr>
<td width="30">
</td>
<td valign="center">
<img src="{img:00040401}"></img></td>
<td valign="center">
Today: {var:today:MM/dd/yyyy}</td>
</tr>
</table>
</FooterTemplate>
<CalendarStyle CssClass="DatePicker1" />
<TitleArrowStyle CssClass="DatePicker9" />
<DayHoverStyle CssClass="DatePicker4" />
<MonthStyle CssClass="DatePicker7" />
<TitleStyle CssClass="DatePicker10" />
<DayHeaderStyle CssClass="DatePicker2" />
<DayStyle CssClass="DatePicker3" />
<PickerStyle CssClass="DatePicker11" />
</eo:DatePicker>
The script:
Code: JavaScript
function Common_Proposed_Eff_Date()
{
var ex = eo_GetObject('Common_Proposed_Exp_DateDatePicker');
var deff = eo_GetObject('Common_Proposed_Eff_DateDatePicker');
var dt = deff.getSelectedDate();
//var dt = ctl00_ContentPlaceHolder1_ctl00_AppFormView_Common_Proposed_Eff_DateDatePicker.getSelectedDate();
//ex.setSelectedDate(dt);
}
If I comment out the first 'var dt = ...' line then the datepicker works correctly again.
Thanks