setPosition dont work







<?php echo $txtDataArrivo ?>















<?php echo $txtDataPartenza ?>





position botton for imput?


setPosition method should be called after draw() method:


mCal.draw();


mCal.setPosition(100,50);


Here 100 is vertical position, 50 is horizontal: calendar.setPosition(Y,X).

setPosition dont work
menu.php.zip (4.88 KB)


If you attach calendar to input, setPosition doesn’t affect - position is set automatically in this case.


If you want to define custom position for the calendar, you should initialize calendar in some container:








mCal = new dhtmlxCalendarObject(‘dhtmlxCalendar’);


mCal.draw();


and set onclick event handlers for the necessary inputs to hide/show calendar:


mCal.hide(); / mCal.show();

if I do as you wrote I lose the connection with the input field, how do avoid it?


If calendar is initialized in div, you can set onSelect event handler and put the chosen date into the necessary input. Please check the sample dhtmlxCalendar/samples/02_date_formating/01_calendar_date_format.html


calendar.attachEvent(“onClick”,function(date){


document.getElementById(“dataIN”).value = calender.getFormatedDate();


}