Browse Source

Update cvv.js

Remove non-numeric characters from creditcard before checking its length to determine the card type.
evilchili 11 years ago
parent
commit
b0cfd1ef4c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/js/validator/cvv.js

+ 2 - 0
src/js/validator/cvv.js

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