diff --git a/dist/better-form-validation.js b/dist/better-form-validation.js index 0db93b2..af4a36b 100644 --- a/dist/better-form-validation.js +++ b/dist/better-form-validation.js @@ -9,7 +9,7 @@ "use strict"; var patterns = {}; - var invalidTypes = [null, "file", "image", "submit", "fieldset", "reset", "button", "hidden"]; + var invalidTypes = [null, "image", "submit", "fieldset", "reset", "button", "hidden"]; var isValidInput = function(el) {return invalidTypes.indexOf(el.get("type")) < 0}; patterns.required = /\S/; @@ -102,6 +102,12 @@ } break; + case "file": + if (required && this.get('files').length === 0) { + errors.push("can't be empty"); + } + break; + default: var value = this.get("value"); // pattern/type validations ignore blank values