dhtmlXForm and calendar

Hello,

I try to attach a calendar on an input and it works but I cannot set insensitive range.
I use myCalendar = form.getCalendar() and myCalendar.setInsensitiveRange(date, null);
It works on a calendar object but on input the days are always sensitive.

[code]var json = [{type:‘fieldset’, label:‘test’, list: [{type:‘hidden’, name:‘id’, label:‘id’, value:10},
{type:‘calendar’, id:‘cal2’, name: “date”, label: “Date:”, dateFormat: “%Y-%m-%d %H:%i”, enableTime: “true”}]}];

var form = new dhtmlXForm(‘fdiv’, json);
var myCalendar = form.getCalendar(‘date’);
myCalendar.setInsensitiveRange(“2011-08-30”, null);[/code]

Is there something wrong ?

Nothing is wrong.

It is an expected behaviour.

Calendar object can’t control the data that is filled in it’s input.
It is recommended to set the input of calendar to read-only mode so the user can’t type the data not supported by “dateFormat” or any API of calendar:

{type:'calendar', id:'cal2', name: "date", label: "Date:", dateFormat: "%Y-%m-%d %H:%i", readonly:1, enableTime: "true"}

Thanks you for the answer but I just want set ‘read-only’ some days on the calendar popup.

Something like this example with a dhtmlXForm input.

As a workaround you may try to use onchange event on the input to deny setting some certain values.