diff --git a/forms/CreditCardField.php b/forms/CreditCardField.php index 7e157cc2e..cdeb61c2c 100644 --- a/forms/CreditCardField.php +++ b/forms/CreditCardField.php @@ -35,6 +35,9 @@ class CreditCardField extends TextField { * @return string */ protected function getTabIndexHTML($increment = 0) { + // we can't add a tabindex if there hasn't been one set yet. + if($this->getAttribute('tabindex') === null) return false; + $tabIndex = (int)$this->getAttribute('tabindex') + (int)$increment; return (is_numeric($tabIndex)) ? ' tabindex = "' . $tabIndex . '"' : ''; }