Last 5 rules ... needing a more complex validation.

For the code below, having problems. When I select Payment Method: Wire, the other Check fields does not require validation. How do I remove the batch of input fields from the validation process when its batch is NOT selected. The only batch input fields that gets validation is based on the value option of paymentmethod3.

Also, be sure to include a div id:areaA

webix.ui({
container:“areaA”,
view:“form”,
scroll:false,
width:600,
margin:0,
padding:0,
id:“form1”,
borderless:true,
elements:[{
view:“tabview”,
tabbar:{ options:[“Personal Info”,“Contact Info”,“Payment Info”]}, animate:false,
cells:[
{ id:“Personal Info”, rows:[
{ rows:[
{ view:“text”, name:“emailaddr1”, label:“Email Address”, value:"", labelWidth:155},
{ view:“text”, name:“firstname1”, label:“First Name”, value:"", labelWidth:155},
{ view:“text”, name:“lastname1”, label:“Last Name”, value:"", labelWidth:155}
]}
]},
{ id:“Contact Info”, rows:[
{ rows:[
{ view:“text”, name:“firstname2B”, label:“First Name”, value:"", labelWidth:155},
{ view:“text”, name:“lastname2B”, label:“Last Name”, value:"", labelWidth:155 },
{ view:“text”, name:“phonenum2B”, label:“Phone Number”, value:"", labelWidth:155 },
{ view:“text”, name:“emailaddr2B”, label:“Email Address”, value:"", labelWidth:155 }
]}
]},
{ id:“Payment Info”, visibleBatch:“Check”, rows:[
{ view:“richselect”, name:“businesstype3”, label:“Business Type”, labelWidth:155, value:“Choose One”, options:[“Online”,“Banking”,“Entertainment”,“Technology”, “Engineering”, “Civil Service”, “Non-profit/Government”,“Other”]},
{ view:“radio”, name:“paymentmethod3”, label:“Payment Method” , labelWidth:155, value:“Check”, options:[“Check”,“Paypal”,“Wire”], click:function(){
$$(“Payment Info”).showBatch(this.getValue());}
},
{ view:“text”, batch:“Check”, name:“checkbankname3”, label:“Bank Name”, labelWidth:155},
{ view:“text”, batch:“Check”, name:“checkrouting3”, label:“Routing Number”, labelWidth:155},
{ view:“text”, batch:“Check”, name:“checkaccount3”, label:“Account Number”, labelWidth:155},
{ view:“text”, batch:“Paypal”, name:“paypalemail3”, label:“Paypal Email”, labelWidth:155},
{ view:“text”, batch:“Wire”, name:“wirebankname3”, label:“Bank Name”, labelWidth:155},
{ view:“text”, batch:“Wire”, name:“wirebankaddress3”, label:“Bank Address”, labelWidth:155},
{ view:“text”, batch:“Wire”, name:“wireacctnum3”, label:“Account Number”, labelWidth:155},
]}
]
},
{
view:“form”, width:200, scroll:false,
cols:[
{ view:“button”, label:“Submit”, height:30, width:100, click:function(){
if ($$(‘form1’).validate()) {
webix.message(“Form has been validated.”);
webix.ajax().post(
“postform.php”,
$$(“publisherCreateForm”).getValues(),
function(text){
//show server side response
webix.message(text);
}
);
}
else
webix.message({ type:“error”, text:“Form is NOT complete.” });
// onAfterValidation takes care of displaying missing/invalid field inputs
}}
]
}
],
rules:{
acctname1: webix.rules.isNotEmpty,
websiteurl1: webix.rules.isNotEmpty,
emailaddr1: webix.rules.isEmail,
password1: webix.rules.isNotEmpty,
firstname1: webix.rules.isNotEmpty,
lastname1: webix.rules.isNotEmpty,
firstname2A: webix.rules.isNotEmpty,
lastname2A: webix.rules.isNotEmpty,
phonenum2A: webix.rules.isNotEmpty,
emailaddr2A: webix.rules.isEmail,
firstname2B: webix.rules.isNotEmpty,
lastname2B: webix.rules.isNotEmpty,
phonenum2B: webix.rules.isNotEmpty,
emailaddr2B: webix.rules.isEmail,
firstname2C: webix.rules.isNotEmpty,
lastname2C: webix.rules.isNotEmpty,
phonenum2C: webix.rules.isNotEmpty,
emailaddr2C: webix.rules.isEmail,
taxclassification3: webix.rules.isNotEmpty,
paymentperiod3: webix.rules.isNotEmpty,
paymentterms3: webix.rules.isNotEmpty,
paymentmethod3: webix.rules.isNotEmpty,
checkbankname3:function(data,obj) {
return ((obj.paymentmethod3.value != “Check”) && ((obj.checkbankname3).length > 2));
},
checkrouting3:function(data,obj) {
return ((obj.paymentmethod3.value != “Check”) && ((obj.checkrouting3).length > 2));
},
checkaccount3:function(data,obj) {
return ((obj.paymentmethod3.value != “Check”) && ((obj.checkaccount3).length > 2));
},
paypalemail3:function(data,obj){
return ((obj.paymentmethod3.value != “Paypal”) && ((obj.paypalemail3).length > 2));
},
wirebankname3:function(data,obj){
return ((obj.paymentmethod3.value != “Wire”) && ((obj.wirebankname3).length > 2));
}
}
});

There is no default solution currently.
The next version may have the updated logic, where validation will not run against hidden fields.

When will the next version drop?

Second part of July.
We are releasing an update each month.