How to set validations( length etc,)

How to set validations to EventName and Descriptions in dhtmlxscheduler for Callendar.

Eg. Event name allowed only 100 characters,
Event Description allowed only 500 characters.

Hello,

You can use onEventSave event to validate all information and block if necessary event saving.

Best regards,
Ilya

Thanks Ilya…

I tested code that was sent by you…
But its working only for eventName, It has to work EventDescription also.
When I add this code, save functionality is not working properly.

And one more, When I click on alert box, it has to clear previous text , how to achieve this?

Eg
if (!data.text.length>20) {
alert(“Text must not be exceed 20 characters”);
return false;
}

give a reply as much as early…

Regards
Santhosh

Hello,

if (!data.text.length>20) {

Data object contains all information which was parsed from the lightbox form. You can access by the name of properties each section is mapped to, e.g.:

scheduler.config.lightbox.sections=[ {name:"additional_info", height:130, map_to:"info", type:"textarea" , focus:true},
In such case as you see additional_info field is mapped to “info” property. So to validate it:

if (!data.info.length>20) { alert("Additional info field must not exceed 20 characters"); return false; }

You can either access lightbox html element (scheduler._lightbox), locate necessary field on it and clear it or simply close and reopen lightbox form for that event (endLightbox --> startLightbox).

Best regards,
Ilya

Thanks Ilya…

Its working properly…

Regards,
Santhosh