Closed garygreen closed 9 years ago
Useful if you want to build a list of rules manually with validatorOptions.
validatorOptions
Example, field 'b' is required when a is present. The proposed required_with rule in validatorjs would help as well.
required_with
var validator = new Dominar($('form'), { a: { rules: 'required' }, b: { validatorOptions: function(options) { if (this.getField('a').getValue().length) { options.rules = 'required'; } return options; } } });
Works fine in fb1df106239488e74b63dd7eacb779371166370c
Useful if you want to build a list of rules manually with
validatorOptions
.Example, field 'b' is required when a is present. The proposed
required_with
rule in validatorjs would help as well.