From c453ea30948b1b7def1e03919f19caa1ffabda8e Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Fri, 20 Sep 2013 11:13:10 +1200 Subject: [PATCH] BUG Fixing tabindex added to CreditCardField when tabindex is NULL The tabindex increment *should* only be done if there is a tabindex that has been set on a CreditCardField already, otherwise it breaks the tab ordering. --- forms/CreditCardField.php | 3 +++ 1 file changed, 3 insertions(+) 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 . '"' : ''; }