What is the best practice to restrict string length for LightboxText user input ? To not allow longer input than size of db field. I did not find any maxLength property for LightboxText.
Hello,
there is no built-in property for validation, but you can attach client-side validation as shown here scheduler-net.com/docs/validatio … lightboxes
this way you can prevent user from saving invalid data.
In order inform user about data invalidity as he enters it, you can attach onchange handler to the text editor and display a warning somewhere:scheduler.attachEvent("onLightbox", function(id){
var textarea = scheduler.formSection("description").control;
textarea.oninput = function(){
if(this.value.length > 50){
this.value = this.value.substring(0, 50) ;
dhtmlx.message({text: "Description is too long", type:"error"});
}
};
});
client-side APIs:
docs.dhtmlx.com/scheduler/api__s … event.html
docs.dhtmlx.com/scheduler/api__s … ction.html