I want to attach the calendar to a icon and a text field.
I used this and text field worked.
<script>
var myCalendar1;
function doOnLoad() {
myCalendar1 = new dhtmlXCalendarObject(["date"]);
myCalendar1.setDateFormat("%m/%d/%Y");
myCalendar1.hideTime();
myCalendar1.disableDays("week", [0, 6]);
myCalendar1.setWeekStartDay(0);
myCalendar1.setDate("03/16/2015");
myCalendar1.setInsensitiveRange(null, "03/15/2015");
}
</script>
but I also wanted to add a icon as well. So I changed the code to this.
<script>
var myCalendar1;
function doOnLoad() {
myCalendar1 = new dhtmlXCalendarObject({input:\"date\",button:\"calendar_icon\"});
myCalendar1.setDateFormat("%m/%d/%Y");
myCalendar1.hideTime();
myCalendar1.disableDays("week", [0, 6]);
myCalendar1.setWeekStartDay(0);
myCalendar1.setDate("03/16/2015");
myCalendar1.setInsensitiveRange(null, "03/15/2015");
}
</script>
This allowed the icon to work, but now the calendar does not pop up when I click the text field only the icon. If there a way to have the icon and a click in the text field both open the calendar.
Thanks.