DHTMLX Docs & Samples Explorer

Attach to input with icon

Source
<link rel="stylesheet" type="text/css" href="../../codebase/dhtmlxcalendar.css">
    <link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxcalendar_dhx_skyblue.css">
    <script src="../../codebase/dhtmlxcalendar.js"></script>
    <style>
        #calendar_input {
            border: 1px solid #909090;
            font-family: Tahoma;
            font-size: 12px;
        }
        #calendar_icon {
            vertical-align: middle;
            cursor: pointer;
        }
    </style>
    <script>
var myCalendar;
function doOnLoad() {
    myCalendar = new dhtmlXCalendarObject({
        input: "calendar_input",
        button: "calendar_icon"
    });
}
</script> <div style="position:relative;height:280px;"> <input type="text" id="calendar_input"> <span><img id="calendar_icon" src="../common/calendar.gif" border="0"></span> </div>