Can one calendar be attached to 2 input fields with icons?

Hello,

I am trying to attach a calendar to two input fields, each with it’s own icon. This is the code I have tried:

var myCal = new dhtmlXCalendarObject({ input: "timeFrom", button: "calendarIcon1, input: "timeTo", button: calendarIcon2" });

Only the second input/icon worked with that. Then I tried:

var myCal = new dhtmlXCalendarObject({ input: "timeFrom, timeTo", button: "calendarIcon1, calendarIcon2" });

But that didn’t work at all. Any help would be much appreciated.

Thanks,

Daryl

Hello
You can try to change its parent (input’s name) as in this sample:
dhtmlx.com/docs/products/dht … arent.html

Hi

var myCal = new dhtmlXCalendarObject([ { input: "timeFrom", button: "calendarIcon1" }, { input: "timeTo", button: "calendarIcon2" } ]);

Hi Andrei & Darya,

Thank you both for your replies, both were very useful. Andrei’s example fit exactly with what I needed to do and works perfectly. Thanks gain.

Regards,

Daryl