Browse Source

#245: cvv validator should support spaces in credit card, thanks to @evilchili

phuoc 11 years ago
parent
commit
ddeec42f04
4 changed files with 6 additions and 2 deletions
  1. 2 1
      CHANGELOG.md
  2. 1 0
      README.md
  3. 2 0
      dist/js/bootstrapValidator.js
  4. 1 1
      dist/js/bootstrapValidator.min.js

+ 2 - 1
CHANGELOG.md

@@ -6,7 +6,8 @@
 * [#233](https://github.com/nghuuphuoc/bootstrapvalidator/issues/233): Add ```threshold``` option
 * [#232](https://github.com/nghuuphuoc/bootstrapvalidator/issues/232): Add ```id``` validator
 * [#242](https://github.com/nghuuphuoc/bootstrapvalidator/issues/242): Add ```separator``` option to the [```numeric``` validator](http://bootstrapvalidator.com/validators/numeric/)
-* [```zipCode``` validator](http://bootstrapvalidator.com/validators/zipCode/) adds support for Italian, Dutch postcodes
+* The [```zipCode``` validator](http://bootstrapvalidator.com/validators/zipCode/) adds support for Italian, Dutch postcodes
+* [#245](https://github.com/nghuuphuoc/bootstrapvalidator/pull/245): The [```cvv``` validator](http://bootstrapvalidator.com/validators/cvv/) should support spaces in credit card, thanks to [@evilchili](https://github.com/evilchili)
 * Change default ```submitButtons``` to ```[type="submit"]``` to support ```input type="submit"```
 * [#238](https://github.com/nghuuphuoc/bootstrapvalidator/issues/238): The submit buttons are not sent
 * Fix the issue that the hidden fields generated by other plugins might not be validated

+ 1 - 0
README.md

@@ -85,6 +85,7 @@ Big thanks to the contributors:
 * [@adgrafik](https://github.com/adgrafik)
 * [@easonhan007](https://github.com/easonhan007)
 * [@emilchristensen](https://github.com/emilchristensen)
+* [@evilchili](https://github.com/evilchili)
 * [@Francismori7](https://github.com/Francismori7)
 * [@gercheq](https://github.com/gercheq)
 * [@henningda](https://github.com/henningda)

+ 2 - 0
dist/js/bootstrapValidator.js

@@ -1202,6 +1202,8 @@
             if (creditCard == '') {
                 return true;
             }
+            
+            creditCard = creditCard.replace(/\D/g, '');
 
             // Supported credit card types
             var cards = {

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