Options
Option | HTML attribute | Type | Description |
---|---|---|---|
creditCardField |
data-fv-cvv-ccfield |
String | The credit card number field. It is null by default |
message |
data-fv-cvv-message |
String | The error message |
When setting options via HTML attributes, remember to
enable the validator by setting data-fv-cvv="true".
The message and other options can be updated on the
fly via the updateMessage() and updateOption() methods
If the creditCardField
option is set, the validator will check if the CVV
number is suitable with the credit card number of not.
In the details, the American Express card only accepts 4 digits CVV number, while other cards only accept 3 digits CVV number.
Example
The following form also validates the CVV number based on the credit card number.
You can use www.getcreditcardnumbers.com to
generate fake credit card numbers.
Related validators
The following validators might be useful to you: