Form validation for dynamic view

Hi webix team,

I am trying to add a form validation for https://snippet.webix.com/naweqfk9 snippet.

I want validation like https://snippet.webix.com/e2c80cfc. But as my form attribute name is dynamic how can I add rule in such case?

Thanks,
Tejal

Hello,

There are three forms which are nested in parent-form. The point is that parent-form doesn’t find values of the nested forms, so validation doesn’t work.
The solution can look like this: https://snippet.webix.com/qlqmp889

  • all config in the one form
  • you can add rules as :

if you need to apply the same rule to each property of the data object, use the $all key

rules:{
      $all:webix.rules.isNotEmpty
    },

if you want to apply different rules for each property of the data object:

 rules:{
        login: webix.rules.isNotEmpty,
        email: webix.rules.isEmail,
        password: webix.rules.isNumber,
        accept: webix.rules.isChecked
    }