mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
If the credit card field is completely blank, then it's not invalid. Required-fields should be used to check for values
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@45076 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c5bce8347c
commit
1eb087eade
@ -73,6 +73,9 @@ JS;
|
||||
}
|
||||
|
||||
function validate($validator){
|
||||
// If the field is empty then don't return an invalidation message
|
||||
if(!trim(implode("", $this->value))) return true;
|
||||
|
||||
$i=0;
|
||||
if($this->value) foreach($this->value as $part){
|
||||
if(!$part || !(strlen($part) == 4) || !ereg("([0-9]{4})",$part)){
|
||||
|
Loading…
Reference in New Issue
Block a user