Valid each element in form control

I have a question relate to valid for each element in form control.

webix.ui({
view:“form”,
elements:[
{ view:“text”, required:true, name:“text1” },
{ view:“text”, invalidMessage: “init”, name:“text2” },
],
elementsConfig:{
on:{
‘onChange’:function(newv, oldv){
this.validate();
}
}
},
rules: {
text2: function (value) {
if (!value) {
$$(“text2”).define(“invalidMessage”, “Text2 can not be empty”);
return false;
}
}
});

It didn’t work with this.validate().
How can we validate for each element with custom valid rule for it.

this.validate() works with the predefined rules. Here’s the solution:

http://webix.com/snippet/b3ff80f6

thanks for your solution. :wink: