myCal.setPosition(input,x,y) doesn't move calendar

Script:



Date of Issue:



                 <input type=“text” id=“invoice_date” name=“invoice_date” value=“<?php echo date("Y/m/21"); ?>” style=“width: 130px;” />

            





Date Due:

<input type=“text” id=“due_date” name=“due_date” value=“<?php echo date("Y/m/d", strtotime("+1 month",strtotime(date("Y/m/20")))); ?>” style=“width: 130px;” />



            

            



My input fields are very close to the right side of the window, and thus the calendar goes off screen and I have to horizontally scroll to find it. I found the setPosition function however in both cases, it does nothing.

Hello,

the syntax of the setPosition method is following:

 calendar.setPosition(obj);
or
 calendar.setPosition(Y,X);

So, in your case:
mCal.setPosition(documen.getElementById(“invoice_date”));

or
mCal2.setPosition(250,10);


It doesn’t matter which one I use, they still do not move the calender onto the screen.  I still have to horizontally scroll to find the calendar. :<br>

Please, provide the sample to recreate the issue.

Hey Alex,

It’s at dni-server.no-ip.com/dniwebd … rl_panel2/

Username: alex
Password: dhtmlx

Then go to Invoicing >> New Invoice

The two fields are “Invoice Date” and “Invoice Due”.

I’d also like to make the calendar disappear when clicking elsewhere on the screen, however the examples I have found also don’t seem to work.

Just a note, I am using FireFox.

I’d also like to make the calendar disappear
Can be done by adding

dhtmlxEvent(document.body,“click”,function(){
cal1.hide();
})

where cal1 - reference to calendar instance

It doesn’t matter which one I use, they still do not move the calender onto the screen
Please check attached sample.

In your current code, setPosition called only once during init, but to fix the problem - correction need to be applied , each time when input activated.

1243870316.zip (69.8 KB)