You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Paul Devine (JIRA)" <ji...@apache.org> on 2006/09/22 18:37:22 UTC
[jira] Created: (VALIDATOR-200) validateCreditCard javascript could
ignore whitespace and hyphens
validateCreditCard javascript could ignore whitespace and hyphens
-----------------------------------------------------------------
Key: VALIDATOR-200
URL: http://issues.apache.org/jira/browse/VALIDATOR-200
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 is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Updated: (VALIDATOR-200) validateCreditCard javascript could
ignore whitespace and hyphens
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/VALIDATOR-200?page=all ]
Niall Pemberton updated VALIDATOR-200:
--------------------------------------
Fix Version/s: 1.4.0
> validateCreditCard javascript could ignore whitespace and hyphens
> -----------------------------------------------------------------
>
> Key: VALIDATOR-200
> URL: http://issues.apache.org/jira/browse/VALIDATOR-200
> Project: Commons Validator
> Issue Type: Improvement
> Components: JavaScript
> Affects Versions: 1.3.0 Release
> Environment: -all-
> Reporter: Paul Devine
> Priority: Minor
> Fix For: 1.4.0
>
>
> 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 is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org