Multiple calendars on one page

I have multiple calendars on one page but if I make a “new dhtmlxCalendarObject” for everyone the page, especially in IE, loads very slowly. Can I have just one calendar and use it for every input text?



Thanks,

Gaizka

Sure, but in such case you will need to use a custom code to show|hide calendar. Something similar to next

mCal = new dhtmlxCalendarObject(‘dhtmlxCalendar’);
mCal.setYearsRange(2000, 2500);
mCal.draw();
mCal.hide();

document.getElementById(“some_input”).onclick=show_calendar;

function show_calendar(){
var input = this;

mCal.setFormatedDate(input.value);
mCal.show();
mCal.setOnClickHandler(function(){
input.value = mCal.getFormatedDate();
mCal.hide();
return true;
});
}

The calendar must appear near every input so i’ve to position it, no?


The calendar can be easily attached to the necessary input:


mCal.setPosition(input);


Where input is the object of the html input