diff --git a/forms/CreditCardField.php b/forms/CreditCardField.php index 7e157cc2e47..cdeb61c2ca8 100644 --- a/forms/CreditCardField.php +++ b/forms/CreditCardField.php @@ -35,6 +35,9 @@ public function Field($properties = array()) { * @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 . '"' : ''; }