How to access a calander object from array

Hi ,

Below is my code snippet

/* dhtmlxCalander fields*/
var hyCalendar;
var DATE_TO_ADD = 20;

var calanderArray = new Array(“maturityDate”,

function createCalendarInstance(calanderArray) {
if (typeof calanderArray === “undefined”) {

if(calanderArray.length === 0) {

var mycalendarArray = "['";
mycalendarArray = mycalendarArray +  "" + calanderArray.join("','");
mycalendarArray = mycalendarArray + "" + "']";

hyCalendar = new dhtmlxCalendarObject(eval(mycalendarArray), true, {
    isYearEditable: true

var d = new Date();
var curr_year = d.getFullYear();

hyCalendar.setYearsRange(curr_year - DATE_TO_ADD, curr_year + DATE_TO_ADD);									   


How can i show and hide based on array passed above

function calendarFocusHandler(name) {

nothing from below commented code works



function calendarBlurHandler(name) {

You can hide calendar by
But there is no way to show calendar and specify at each input it must be rendered at the same time. Calendar is linked to target inputs and will appear automatically , after clicking related input.

If you need more detailed control over behavior, you need to create separate calendar controls for each area.

Hello Stan,

I seperated out each calendar creation, what i want now is onfocus of a textbox associated with calander i want it to show and onblur it should hide, how can i achieve it.

should i write onfocus for each textbox if yes how will i get the pobject refrerence of calendar.

Appreciate your help.

Hi Stan,

I was able to achive that as well. but another problem now i face is “onfocus” of textbox the calander is drawn, after i select the date the tab index is lost, it doent go to the next element in the page.

how should i achieve this.

Apreciate your help

Best regards

Check the attached sample (36.6 KB)

Hi Stan,

The Example zip you gave, open on focus of textbox, thanks for this. but when selection of a date ,it doesn’t populate the corresponding TextBox.

Appreciate if you can help us out.

Best Regards

we found the solution, we modified the existing js to make it work for our usecase. thanks all