javascript - How to valid each element by onChange in web-ix form -


i have question relate valid 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 empty");             return false;         }     } }); 

it didn't work this.validate(). how can validate each element custom valid rule it.

adds id , name form.

... id:"form1", name:"form1", ... 

the rule

rules: {         "text2":function (value) {         console.log(value)             if (value != "") {             $$("text2").define("invalidmessage", "text2 can not empty");             return false;         }       }     } 

see example


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -