|
@@ -763,10 +763,16 @@
|
|
|
else if ('object' === typeof validateResult && validateResult.valid !== undefined && validateResult.message !== undefined) {
|
|
else if ('object' === typeof validateResult && validateResult.valid !== undefined && validateResult.message !== undefined) {
|
|
|
this.updateMessage(updateAll ? field : $field, validatorName, validateResult.message);
|
|
this.updateMessage(updateAll ? field : $field, validatorName, validateResult.message);
|
|
|
this.updateStatus(updateAll ? field : $field, validateResult.valid ? this.STATUS_VALID : this.STATUS_INVALID, validatorName);
|
|
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
|
|
// ... or a boolean value
|
|
|
else if ('boolean' === typeof validateResult) {
|
|
else if ('boolean' === typeof validateResult) {
|
|
|
this.updateStatus(updateAll ? field : $field, validateResult ? this.STATUS_VALID : this.STATUS_INVALID, validatorName);
|
|
this.updateStatus(updateAll ? field : $field, validateResult ? this.STATUS_VALID : this.STATUS_INVALID, validatorName);
|
|
|
|
|
+ if (!validateResult && !this.options.verbose) {
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1641,7 +1647,15 @@
|
|
|
live: 'enabled',
|
|
live: 'enabled',
|
|
|
|
|
|
|
|
// Map the field name with validator rules
|
|
// Map the field name with validator rules
|
|
|
- fields: null
|
|
|
|
|
|
|
+ fields: null,
|
|
|
|
|
+
|
|
|
|
|
+ // 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
|
|
// Available validators
|