Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Manoj Kumar on Apr 06, 2009 01:34
open dhtmlx forum
Date is not getting selected in calander whatever in text box

I am using calendar with textbox and calender image(to open calander). When user clicks on calender image, calender opens and I can select date. That date goes to text box with selection.

Problem:
But if date is there in textbox and I click on calander Image then calander is not coming with selected date what ever in testbox. It is always shows current date as default selected.
Please suggest how can we set calendar date selection as per textbox date while opening.
Answer posted by Alex (support) on Apr 06, 2009 05:53

Which method do you use to show calendar?

In case of using hide() / show() this issue doesn't occur:

http://dhtmlx.com/docs/products/dhtmlxCalendar/samples/other_functionality/calendar_hide_show.html

Answer posted by Manoj Kumar on Apr 06, 2009 06:15
I want to change selected date in calendar. like

var objCalendar = $find("ph_cal_tbdEntryDate_cal");

 objCalendar.value(dd/mm/yyyy); // This is not working

Answer posted by Alex (support) on Apr 06, 2009 09:49
There is setDate(date) method to select date in calendar.
Answer posted by Manoj Kumar on Apr 06, 2009 20:43
Yes I have tried this method. But $find("ph_cal_tbdEntryDate_cal") object is not supportin this method. I can not use

'new dhtmlxCalendarObject("tbdEntryDate_tb")' because calander is already generated.

Answer posted by Alex (support) on Apr 07, 2009 01:17

The calendar object is:

var calObj = new dhtmlxCalendarObject("tbdEntryDate_tb");

So, the setDate call is:

calObj.setDate(date);