attaches a calendar to an input field
input | string|number|HTMLElement | input id, input DOM element |
string|number | attachment id, you can use it for detachObj(id) later |
Any calendar instance can be attached to several inputs. You can do it using the following ways:
1) to pass the input id:
<input type="text" id="input1">
<input type="text" id="input2">
<input type="text" id="input3">
var myCalendar = new dhtmlXCalendarObject(["input1","input2"]);
var objId = myCalendar.attachObj("input3");
2) to pass the input DOM element:
<input type="text" id="input1">
<input type="text" id="input2">
<input type="text" id="input3">
var myCalendar = new dhtmlXCalendarObject(["input1","input2"]);
var inputObj = document.getElementById("input3");
myCalendar.attachObj(inputObj);
3) for an input with an icon:
<input type="text" id="input1">
<input type="text" id="input2">
<input type="text" id="input3">
<img id="icon" src="calendar.gif" border="0">
var myCalendar = new dhtmlXCalendarObject(["input1", "input2"]);
myCalendar.attachObj({input: "input3", button: "icon"});
Back to top