views:

177

answers:

0

I have a textbox with calendar extender and a label

           <label for="<%= tbxFrom.ClientID %>">
                From</label>
                <asp:Label ID="lblWeekDayFrom" runat="server"></asp:Label>
            <asp:TextBox ID="tbxFrom" runat="server" CssClass="Calendar"></asp:TextBox>
            <cc1:CalendarExtender ID="extTbxFrom" runat="server" TargetControlID="tbxStartTag">
            </cc1:CalendarExtender>

and now I would like to show the weekday of the currently selected date, either using a formatting inside the textbox like

Fr 06/20/2010

or showing the weekday as string using the label on the left side of the texbox (lblWeekDayFrom). There is a calendarExtender to select the date, but I would also like to offer the users to enter the date manually like they can now.

I tried to use JQuery to capture changes, but the label is not showing anything, and it triggers the RequiredFieldValidator on every initial page load.

 $(document).ready(function() 
    {
       $('#<%= tbxFrom.ClientID %>').change(updateDate($('#<%= tbxFrom.ClientID %>').val()))    
    }
  );
 function updateDate(date)  
 {  
    $('#<%= lblWeekDayFrom.ClientID %>').val(date);   
 }