I have 2 textboxes, fromDate and ToDate. I have made a small button next to these textboxes so once they r clicked a calendar control displays and v can pick the dates. I dont want to have all the postback issue with the button control so I have used the
javascript to display the calendar control on a button click.
I want to put the selected dates in the textboxes. But selecting the date from the calendar control will again post back. I dont want this post back issue. Is there a way where i can again use the javascript to select the dates from the asp.net calendar
control?
2) My second option is, is there a way that I can use just one calendar control to store 2 dates in these 2 textboxes?
Thnx for the link. The solution looked very simple. I wrote the exact code and tried running it and I'm not getting the result. May the the reference link they have mentioned r necessary i guess.
I dont know how familiar you are with jQuery. is the text box you are trying to tie it to just so happen to be an asp.net textbox? if it is i know what the issue is.
Please remember to Mark the replies as Answers if they help & unmark them if they provide no help.
Ya I'm trying to display the date in the asp.net textbox. The datepicker is just showing up but I'm not able to pick the date . When I click on some date then the datepicker disapears and The value is not stored in the textbox.
slm3003
Member
133 Points
166 Posts
Picking dates from a calender control
Dec 11, 2012 07:44 PM|LINK
Hi All,
I have 2 textboxes, fromDate and ToDate. I have made a small button next to these textboxes so once they r clicked a calendar control displays and v can pick the dates. I dont want to have all the postback issue with the button control so I have used the javascript to display the calendar control on a button click.
I want to put the selected dates in the textboxes. But selecting the date from the calendar control will again post back. I dont want this post back issue. Is there a way where i can again use the javascript to select the dates from the asp.net calendar control?
2) My second option is, is there a way that I can use just one calendar control to store 2 dates in these 2 textboxes?
Please help.
firexfighter...
Member
248 Points
66 Posts
Re: Picking dates from a calender control
Dec 11, 2012 07:48 PM|LINK
Your in luck! jQuery my friend is your best friend!! check out this link: http://jqueryui.com/datepicker/
slm3003
Member
133 Points
166 Posts
Re: Picking dates from a calender control
Dec 11, 2012 08:41 PM|LINK
Hi Firefighterx,
Thnx for the link. The solution looked very simple. I wrote the exact code and tried running it and I'm not getting the result. May the the reference link they have mentioned r necessary i guess.
firexfighter...
Member
248 Points
66 Posts
Re: Picking dates from a calender control
Dec 11, 2012 08:52 PM|LINK
I dont know how familiar you are with jQuery. is the text box you are trying to tie it to just so happen to be an asp.net textbox? if it is i know what the issue is.
slm3003
Member
133 Points
166 Posts
Re: Picking dates from a calender control
Dec 12, 2012 02:22 PM|LINK
Ya I'm trying to display the date in the asp.net textbox. The datepicker is just showing up but I'm not able to pick the date . When I click on some date then the datepicker disapears and The value is not stored in the textbox.
firexfighter...
Member
248 Points
66 Posts
Re: Picking dates from a calender control
Dec 12, 2012 04:26 PM|LINK
WIth asp.net controls you can access the client ID of the control and tie jQuery to it. try it like this and see if it works.
$("#<%= myTextBox.ClientID %>").datepicker();Make sure this is under your document.ready function. let me knwo if this works.
aarsh
Participant
1543 Points
428 Posts
Re: Picking dates from a calender control
Dec 12, 2012 04:37 PM|LINK
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/Calendar/Calendar.aspx you can download this free library from here : http://ajaxcontroltoolkit.codeplex.com/
firexfighter...
Member
248 Points
66 Posts
Re: Picking dates from a calender control
Dec 12, 2012 07:00 PM|LINK
I would have to disagree. An Ajax calendar is much bulkier and the datepicker from jQuery is built in!
slm3003
Member
133 Points
166 Posts
Re: Picking dates from a calender control
Dec 12, 2012 07:05 PM|LINK
Thnx Aarsh,
Ajax Toolkit's, CalendarExtender worked for me. This was exactly what I wanted.
firexfighterx, datepicker also worked when I downloaded the correct plugin