Commit 87f58e48 by Tomek Romik Committed by Qiang Xue

Abort further validation if there are no files to validate

parent 8c5c4c50
......@@ -73,13 +73,14 @@ yii.validation = (function ($) {
if (options.message && !files) {
pub.addMessage(messages, options.message);
}
if (!options.skipOnEmpty && files.length === 0) {
pub.addMessage(messages, options.uploadRequired);
} else if (files.length === 0) {
if (files.length === 0) {
if (!options.skipOnEmpty) {
pub.addMessage(messages, options.uploadRequired);
}
return false;
}
if (options.maxFiles && options.maxFiles < files.length) {
pub.addMessage(messages, options.tooMany);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment