how to get the selected date from calender control to my textbox
I have a calendar control with two textboxes. One textbox is for fromdate and other is for todate.
I need to select two dates. How can I get the dates开发者_高级运维 selected from the calender control into my textboxes?
It depends on how your calendar control returns the data, but you basically just assign the returned value to the textbox value property:
document.getElementById('textbox1').value = calendarControl.getDate();
you can use calender extender.
<asp:TextBox ID="txt_InvoiceDate" runat="server" CssClass="txtborder" Width="70px"
ReadOnly="true"></asp:TextBox>
<asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="images/ico_calendar.gif" />
<asp:CalendarExtender ID="txt_date_of_visit_CalendarExtender" runat="server" Enabled="True"
Format="dd-MM-yyyy" TargetControlID="txt_InvoiceDate" PopupButtonID="ImageButton3">
</asp:CalendarExtender>
精彩评论