phuoc 11 years ago
parent
commit
aeb7cde40e

+ 2 - 7
dist/js/bootstrapValidator.js

@@ -14,8 +14,6 @@
         this.$form   = $(form);
         this.$form   = $(form);
         this.options = $.extend({}, BootstrapValidator.DEFAULT_OPTIONS, options);
         this.options = $.extend({}, BootstrapValidator.DEFAULT_OPTIONS, options);
 
 
-        this.results = {};          // Validating results
-
         this.$invalidField = null;  // First invalid field
         this.$invalidField = null;  // First invalid field
         this.$submitButton = null;  // The submit button which is clicked to submit form
         this.$submitButton = null;  // The submit button which is clicked to submit form
 
 
@@ -189,8 +187,6 @@
                 return;
                 return;
             }
             }
 
 
-            this.results[field] = {};
-
             var fields = this.getFieldElements(field);
             var fields = this.getFieldElements(field);
 
 
             // We don't need to validate non-existing fields
             // We don't need to validate non-existing fields
@@ -228,10 +224,9 @@
                 });
                 });
 
 
                 // Create help block elements for showing the error messages
                 // Create help block elements for showing the error messages
-                $field.data('bv.messageContainer', $message);
+                $field.data('bv.messages', $message);
                 for (validatorName in this.options.fields[field].validators) {
                 for (validatorName in this.options.fields[field].validators) {
                     $field.data('bv.result.' + validatorName, this.STATUS_NOT_VALIDATED);
                     $field.data('bv.result.' + validatorName, this.STATUS_NOT_VALIDATED);
-                    //this.results[field][validatorName] = this.STATUS_NOT_VALIDATED;
 
 
                     if (!updateAll || i == total - 1) {
                     if (!updateAll || i == total - 1) {
                         $('<small/>')
                         $('<small/>')
@@ -508,7 +503,7 @@
             var that     = this,
             var that     = this,
                 field    = $field.attr('data-bv-field'),
                 field    = $field.attr('data-bv-field'),
                 $parent  = $field.parents('.form-group'),
                 $parent  = $field.parents('.form-group'),
-                $message = $field.data('bv.messageContainer'),
+                $message = $field.data('bv.messages'),
                 $errors  = $message.find('.help-block[data-bv-validator]'),
                 $errors  = $message.find('.help-block[data-bv-validator]'),
                 $icon    = $parent.find('.form-control-feedback[data-bv-field="' + field + '"]');
                 $icon    = $parent.find('.form-control-feedback[data-bv-field="' + field + '"]');
 
 

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


+ 2 - 7
src/js/bootstrapValidator.js

@@ -13,8 +13,6 @@
         this.$form   = $(form);
         this.$form   = $(form);
         this.options = $.extend({}, BootstrapValidator.DEFAULT_OPTIONS, options);
         this.options = $.extend({}, BootstrapValidator.DEFAULT_OPTIONS, options);
 
 
-        this.results = {};          // Validating results
-
         this.$invalidField = null;  // First invalid field
         this.$invalidField = null;  // First invalid field
         this.$submitButton = null;  // The submit button which is clicked to submit form
         this.$submitButton = null;  // The submit button which is clicked to submit form
 
 
@@ -188,8 +186,6 @@
                 return;
                 return;
             }
             }
 
 
-            this.results[field] = {};
-
             var fields = this.getFieldElements(field);
             var fields = this.getFieldElements(field);
 
 
             // We don't need to validate non-existing fields
             // We don't need to validate non-existing fields
@@ -227,10 +223,9 @@
                 });
                 });
 
 
                 // Create help block elements for showing the error messages
                 // Create help block elements for showing the error messages
-                $field.data('bv.messageContainer', $message);
+                $field.data('bv.messages', $message);
                 for (validatorName in this.options.fields[field].validators) {
                 for (validatorName in this.options.fields[field].validators) {
                     $field.data('bv.result.' + validatorName, this.STATUS_NOT_VALIDATED);
                     $field.data('bv.result.' + validatorName, this.STATUS_NOT_VALIDATED);
-                    //this.results[field][validatorName] = this.STATUS_NOT_VALIDATED;
 
 
                     if (!updateAll || i == total - 1) {
                     if (!updateAll || i == total - 1) {
                         $('<small/>')
                         $('<small/>')
@@ -507,7 +502,7 @@
             var that     = this,
             var that     = this,
                 field    = $field.attr('data-bv-field'),
                 field    = $field.attr('data-bv-field'),
                 $parent  = $field.parents('.form-group'),
                 $parent  = $field.parents('.form-group'),
-                $message = $field.data('bv.messageContainer'),
+                $message = $field.data('bv.messages'),
                 $errors  = $message.find('.help-block[data-bv-validator]'),
                 $errors  = $message.find('.help-block[data-bv-validator]'),
                 $icon    = $parent.find('.form-control-feedback[data-bv-field="' + field + '"]');
                 $icon    = $parent.find('.form-control-feedback[data-bv-field="' + field + '"]');