|
|
@@ -814,10 +814,16 @@
|
|
|
else if ('object' === typeof validateResult && validateResult.valid !== undefined && validateResult.message !== undefined) {
|
|
|
this.updateMessage(updateAll ? field : $field, validatorName, validateResult.message);
|
|
|
this.updateStatus(updateAll ? field : $field, validateResult.valid ? this.STATUS_VALID : this.STATUS_INVALID, validatorName);
|
|
|
+ if (!validateResult.valid && !this.options.verbose) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
// ... or a boolean value
|
|
|
else if ('boolean' === typeof validateResult) {
|
|
|
this.updateStatus(updateAll ? field : $field, validateResult ? this.STATUS_VALID : this.STATUS_INVALID, validatorName);
|
|
|
+ if (!validateResult && !this.options.verbose) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1704,7 +1710,15 @@
|
|
|
fieldStatus: 'status.field.bv',
|
|
|
validatorError: 'error.validator.bv',
|
|
|
validatorSuccess: 'success.validator.bv'
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+ // Whether to be verbose when validating a field or not.
|
|
|
+ // Possible values:
|
|
|
+ // - true: when a field has multiple validators, all of them will be checked, and respectively - if errors occur in
|
|
|
+ // multiple validators, all of them will be displayed to the user
|
|
|
+ // - false: when a field has multiple validators, validation for this field will be terminated upon the first encountered error.
|
|
|
+ // Thus, only the very first error message related to this field will be displayed to the user
|
|
|
+ verbose: true
|
|
|
};
|
|
|
|
|
|
// Available validators
|