In fact, the form might have multiple fields with the same validator rules but at least one
of them is required. We can't use neither the notEmpty
validator nor HTML 5 required attribute for all of them.
Fortunately, this can be done easily by
Using the selector option to define validators
for all fields. So, we don't need to indicate the validator rules for each separate
field.
Using the callback validator to check if one of
fields is not empty. And then update the result of callback validator via the updateStatus() method.
You also can look at the Using hidden field technique example
which introduces another way to require one of two fields