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:
Sam Minnee 2007-11-19 03:11:38 +00:00
parent c5bce8347c
commit 1eb087eade

View File

@ -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)){