Browse Source

#177: Fix VIN validator

nghuuphuoc 11 years ago
parent
commit
0521c3bec1
3 changed files with 6 additions and 6 deletions
  1. 2 2
      dist/js/bootstrapValidator.js
  2. 2 2
      dist/js/bootstrapValidator.min.js
  3. 2 2
      src/js/validator/vin.js

+ 2 - 2
dist/js/bootstrapValidator.js

@@ -2368,7 +2368,7 @@
          */
          */
         validate: function(validator, $field, options) {
         validate: function(validator, $field, options) {
             var value = $field.val();
             var value = $field.val();
-            if (value == '' || !options.country) {
+            if (value == '') {
                 return true;
                 return true;
             }
             }
 
 
@@ -2396,7 +2396,7 @@
                 reminder = 'X';
                 reminder = 'X';
             }
             }
 
 
-            return reminder == value[8];
+            return reminder == value.charAt(8);
         }
         }
     };
     };
 }(window.jQuery));
 }(window.jQuery));

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


+ 2 - 2
src/js/validator/vin.js

@@ -11,7 +11,7 @@
          */
          */
         validate: function(validator, $field, options) {
         validate: function(validator, $field, options) {
             var value = $field.val();
             var value = $field.val();
-            if (value == '' || !options.country) {
+            if (value == '') {
                 return true;
                 return true;
             }
             }
 
 
@@ -39,7 +39,7 @@
                 reminder = 'X';
                 reminder = 'X';
             }
             }
 
 
-            return reminder == value[8];
+            return reminder == value.charAt(8);
         }
         }
     };
     };
 }(window.jQuery));
 }(window.jQuery));