I have a calendar which attached to a text input. I want to keep text input editable and want to popup calendar when a button/icon is clicked and then set the date in text input. I got the following code but, when I click on calendar image, I get javascript error:
this.parent is null
onMonthSelect()()dhtmlxcalendar.js (line 84)
(?)()()edit (line 1176)
[Break on this error] this.onLanguageLoaded(status)};function…ct = function(value) {if (!isNaN(value))
My code:

MM/DD/YYYY
There are some mistakes in your code:
1) method draw() isn’t called. This method is necessary:
cal_16.setSkin(‘yahoolike’);
cal_16.draw();
cal_16.hide();
2)
This code calls body onclick - and calendar closes.
Thanks for the reply!
Making suggested change won’t work either.
cal_16.draw();
$(‘cal_container_10’).hide();// hide the container
now in onClick I call $(‘cal_container_10’).show(); calendar won’t show. I also tried calling cal_16.show() but clicking on icon won’t show the calendar. I don’t get any javascript errors now.
function openCalendar_10() {
alert(cal_10);
$(‘cal_container_10’).show();
//cal_10.isVisible() ? cal_10.hide() : cal_10.show();
}
In my previous reply I’ve written about two mistakes in your code. Please, check the 2) once again.
You don’t cancel bubbling in the onclick event handler of the image. That is why the body onclick event handler is called (dhtmlxEvent(document.body,“click”,function(){ cal_16.hide(); })
- calendar closes.
Afternoon!
The example that ‘Anonymous’ wanted to implement is valid. We’re trying to do the same thing, with the same results.
Can you provide a simple example that ties a text to a calendar, but that has a small calendar image that when clicked opens the calendar?
Clicking on either the text, or the image, to open the calendar helps with usability. The user knows what behaviour to expect, when he see this text/calendar icon pair.
Thanks!
Will.
Hi,
take a loot at the attached sample
sample.zip (37.8 KB)