开发者

how to get the selected date from calender control to my textbox

开发者 https://www.devze.com 2023-01-02 07:28 出处:网络
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 contro

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消