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 ($) { ...@@ -73,13 +73,14 @@ yii.validation = (function ($) {
if (options.message && !files) { if (options.message && !files) {
pub.addMessage(messages, options.message); pub.addMessage(messages, options.message);
} }
if (!options.skipOnEmpty && files.length === 0) { if (files.length === 0) {
pub.addMessage(messages, options.uploadRequired); if (!options.skipOnEmpty) {
} else if (files.length === 0) { pub.addMessage(messages, options.uploadRequired);
}
return false; return false;
} }
if (options.maxFiles && options.maxFiles < files.length) { if (options.maxFiles && options.maxFiles < files.length) {
pub.addMessage(messages, options.tooMany); 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