Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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.
  • Loading branch information...
commit b383a07f90090638deb00923ff07ec5c477365bb 1 parent f765696
@halkyon halkyon authored chillu committed
Showing with 3 additions and 0 deletions.
  1. +3 −0  forms/CreditCardField.php
View
3  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 . '"' : '';
}
Please sign in to comment.
Something went wrong with that request. Please try again.