Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Mar 05, 2009 16:07
open dhtmlx forum
calendar - disable/enable calendar on input text

I am using calendar on click on 'myCalendarTextField' field:

myCalendar = new dhtmlxCalendarObject('myCalendarTextField',true,{isYearEditable: true,isMonthEditable: true});

<input type="calendar" readonly="true" id="'myCalendarTextField'" name="calendar" size="10"">

I want to disable/enable calendar on that text field per some conditions. How can we control that?

Thanks.
Answer posted by Alex (support) on Mar 06, 2009 02:11

There is no built-in functionality to do that. You can try to use the following approach:

myCalendar = new dhtmlxCalendarObject('myCalendarTextField',true,{isYearEditable: true,isMonthEditable: true});
myCalendar._onclick = myCalendar.con.onclick;

...

function disable(){

myCalendar.con.onclick=function(){}

}

function enable(){

myCalendar.con.onclick=myCalendar._onclick;

}

Answer posted on Mar 06, 2009 05:21
it works now! thanks!