Browse Source

#232: Validate Slovak national identifier number (RC)

phuoc 11 years ago
parent
commit
1df0507ff1
3 changed files with 29 additions and 1 deletions
  1. 14 0
      dist/js/bootstrapValidator.js
  2. 1 1
      dist/js/bootstrapValidator.min.js
  3. 14 0
      src/js/validator/id.js

+ 14 - 0
dist/js/bootstrapValidator.js

@@ -1993,6 +1993,20 @@
                 return false;
             }
             return $.fn.bootstrapValidator.helpers.mod_11_10(value);
+        },
+
+        /**
+         * Validate Slovak national identifier number (RC)
+         * Examples:
+         * - Valid: 7103192745, 991231123
+         * - Invalid: 7103192746, 1103492745
+         *
+         * @param {String} value The ID
+         * @returns {Boolean}
+         */
+        _sk: function(value) {
+            // Slovakia uses the same format as Czech Republic
+            return this._cz(value);
         }
     };
 }(window.jQuery));

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


+ 14 - 0
src/js/validator/id.js

@@ -194,6 +194,20 @@
                 return false;
             }
             return $.fn.bootstrapValidator.helpers.mod_11_10(value);
+        },
+
+        /**
+         * Validate Slovak national identifier number (RC)
+         * Examples:
+         * - Valid: 7103192745, 991231123
+         * - Invalid: 7103192746, 1103492745
+         *
+         * @param {String} value The ID
+         * @returns {Boolean}
+         */
+        _sk: function(value) {
+            // Slovakia uses the same format as Czech Republic
+            return this._cz(value);
         }
     };
 }(window.jQuery));