commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Resolved] (VALIDATOR-200) validateCreditCard javascript could ignore whitespace and hyphens
Date Wed, 07 Jan 2015 00:02:36 GMT


Sebb resolved VALIDATOR-200.
       Resolution: Won't Fix
    Fix Version/s:     (was: Validator2)

Javascript routines are no longer maintained and have been deprecated

> validateCreditCard javascript could ignore whitespace and hyphens
> -----------------------------------------------------------------
>                 Key: VALIDATOR-200
>                 URL:
>             Project: Commons Validator
>          Issue Type: Improvement
>          Components: JavaScript
>    Affects Versions: 1.3.0 Release
>         Environment: -all-
>            Reporter: Paul Devine
>            Priority: Minor
> the validateCreditCard javascript routine flags an input field as an invalid credit card
number if the input field contains any non-numeric characters or whitespaces.  I currently
modify the input field's value before validation to remove whitespaces and hyphens, like this:
> $('paymentForm:cardNumber').value = $('paymentForm:cardNumber').value.replace(/ /g,'');
> $('paymentForm:cardNumber').value = $('paymentForm:cardNumber').value.replace(/-/g,'');
> It would be simple enough to have the validateCreditCard function handle this, but rather
than modifying the input field value, it would modify the variable it is validating on, so
the user does not see any `change` in what they have entered

This message was sent by Atlassian JIRA

View raw message