Merge pull request #2434 from halkyon/cc_tabindex_fix_2

BUG Fixing tabindex added to CreditCardField when tabindex is NULL
This commit is contained in:
Ingo Schommer 2013-09-19 16:37:58 -07:00
commit 2dd7baac16

View File

@ -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 . '"' : '';
}