I have two text boxes on a screen. I initialize the calendar with the first text box and then in the onclick event of the second text box , I use the attachobject method of the calendar to attach the calendar to the second text box. How ever this throws the following error:
There is setParent method that attaches calendar to another div. However, it won’t apply features that are actual when you attaches calendar to several inputs.
Also you may use setPosition method which displays calendar in a certain top and left position. Here are the post with the latest libraries attached: viewtopic.php?f=7&t=20171&p=64207#p64207
Please use them
I have used the set parent and it is working, but as you said it won’t apply features that are actual when you attaches calendar to several inputs. I need to access the date returned and put it back into my text back. How can I access its parent? I have tried one of your suggestions in your previous post
var id = (typeof calendar.contId != ‘string’?calendar.contId.id:calendar.contId);
But it is throwing an error - " contid is undefined "
Is there a way we can make the attachobject function work?
Calendar doesn’t support attachObject method. You can either attach calendar to several inputs or create a simple calendar with div as a parent container. In the latter case, you may use setPosition method to show calendar in different positions.
If you want to use automatic attaching to inputs, you may unload the existent calendar and then create it for another set of inputs:
myCalendar = new dhtmlXCalendarObject([“input1”]);
/to add more inputs/
myCalendar.unload();
myCalendar = new dhtmlXCalendarObject([“input1”,“input2”,“input3”]);