Browse Source

#77, #117: notEmpty validator doesn't work on file input

nghuuphuoc 11 years ago
parent
commit
1be8ad725b

+ 8 - 0
CHANGELOG.md

@@ -1,5 +1,13 @@
 # Change Log
 
+## v0.3.3
+
+Not released yet
+
+__Fixes__:
+
+[#77, #117: ```notEmpty``` validator doesn't work on file input](https://github.com/nghuuphuoc/bootstrapvalidator/issues/117)
+
 ## v0.3.2
 
 Released on 2014-03-21

+ 1 - 1
dist/css/bootstrapValidator.min.css

@@ -3,7 +3,7 @@
  *
  * A jQuery plugin to validate form fields. Use with Bootstrap 3
  *
- * @version     v0.3.2
+ * @version     v0.3.3-dev
  * @author      https://twitter.com/nghuuphuoc
  * @copyright   (c) 2013 - 2014 Nguyen Huu Phuoc
  * @license     MIT

+ 3 - 3
dist/js/bootstrapValidator.js

@@ -3,7 +3,7 @@
  *
  * A jQuery plugin to validate form fields. Use with Bootstrap 3
  *
- * @version     v0.3.2
+ * @version     v0.3.3-dev
  * @author      https://twitter.com/nghuuphuoc
  * @copyright   (c) 2013 - 2014 Nguyen Huu Phuoc
  * @license     MIT
@@ -184,7 +184,7 @@
             // Whenever the user change the field value, mark it as not validated yet
             var that  = this,
                 type  = fields.attr('type'),
-                event = ('radio' == type || 'checkbox' == type || 'SELECT' == fields[0].tagName) ? 'change' : 'keyup';
+                event = ('radio' == type || 'checkbox' == type || 'file' == type || 'SELECT' == fields[0].tagName) ? 'change' : 'keyup';
             fields.on(event + '.bootstrapValidator', function() {
                 that.updateStatus($field, that.STATUS_NOT_VALIDATED, null);
             });
@@ -229,7 +229,7 @@
                         var fields = that.getFieldElements(f);
                         if (fields) {
                             var type  = fields.attr('type'),
-                                event = ('radio' == type || 'checkbox' == type || 'SELECT' == fields[0].tagName) ? 'change' : 'keyup';
+                                event = ('radio' == type || 'checkbox' == type || 'file' == type || 'SELECT' == fields[0].tagName) ? 'change' : 'keyup';
 
                             fields.on(event + '.bootstrapValidator', function() {
                                 that.validateField(f);

File diff suppressed because it is too large
+ 2 - 2
dist/js/bootstrapValidator.min.js


+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
     "name": "bootstrapValidator",
-    "version": "0.3.2",
+    "version": "0.3.3-dev",
     "description": "A jQuery plugin to validate form fields. Use with Bootstrap 3",
     "keywords": ["jQuery", "plugin", "validator", "Bootstrap"],
     "author": {

+ 2 - 2
src/js/bootstrapValidator.js

@@ -183,7 +183,7 @@
             // Whenever the user change the field value, mark it as not validated yet
             var that  = this,
                 type  = fields.attr('type'),
-                event = ('radio' == type || 'checkbox' == type || 'SELECT' == fields[0].tagName) ? 'change' : 'keyup';
+                event = ('radio' == type || 'checkbox' == type || 'file' == type || 'SELECT' == fields[0].tagName) ? 'change' : 'keyup';
             fields.on(event + '.bootstrapValidator', function() {
                 that.updateStatus($field, that.STATUS_NOT_VALIDATED, null);
             });
@@ -228,7 +228,7 @@
                         var fields = that.getFieldElements(f);
                         if (fields) {
                             var type  = fields.attr('type'),
-                                event = ('radio' == type || 'checkbox' == type || 'SELECT' == fields[0].tagName) ? 'change' : 'keyup';
+                                event = ('radio' == type || 'checkbox' == type || 'file' == type || 'SELECT' == fields[0].tagName) ? 'change' : 'keyup';
 
                             fields.on(event + '.bootstrapValidator', function() {
                                 that.validateField(f);