From 955d500a95aa5f25c2113c4acdf59cd646546f4a Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 16 Sep 2008 23:14:31 +0000 Subject: [PATCH] BUGFIX createTag() on FormField subclasses should use getTabIndex() instead of getTabIndexHTML() as createTag() is responsible for generating the HTML, and all we need is the tabindex value git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62490 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/AjaxFormAction.php | 3 ++- forms/AjaxUniqueTextField.php | 2 +- forms/AutocompleteTextField.php | 2 +- forms/CheckboxFieldDisabled.php | 2 +- forms/ConfirmedFormAction.php | 3 ++- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/forms/AjaxFormAction.php b/forms/AjaxFormAction.php index 88ecd5378..4fef2dbae 100755 --- a/forms/AjaxFormAction.php +++ b/forms/AjaxFormAction.php @@ -18,13 +18,14 @@ class AjaxFormAction extends FormAction { $this->ajaxAction = $ajaxAction ? $ajaxAction : $action; parent::__construct($action, $title, $form); } + function Field() { return $this->createTag('input', array( 'class' => "ajaxAction-$this->ajaxAction action", 'id' => $this->id(), 'type' => 'submit', 'value' => $this->title, - 'tabindex' => $this->getTabIndexHTML() + 'tabindex' => $this->getTabIndex() )); } diff --git a/forms/AjaxUniqueTextField.php b/forms/AjaxUniqueTextField.php index 4234fa6be..81edd029e 100644 --- a/forms/AjaxUniqueTextField.php +++ b/forms/AjaxUniqueTextField.php @@ -44,7 +44,7 @@ class AjaxUniqueTextField extends TextField { 'id' => $this->id(), 'name' => $this->Name(), 'value' => $this->Value(), - 'tabindex' => $this->getTabIndexHTML(), + 'tabindex' => $this->getTabIndex(), 'maxlength' => ($this->maxLength) ? $this->maxLength : null ); diff --git a/forms/AutocompleteTextField.php b/forms/AutocompleteTextField.php index 584f2a725..b195f20f5 100644 --- a/forms/AutocompleteTextField.php +++ b/forms/AutocompleteTextField.php @@ -26,7 +26,7 @@ class AutocompleteTextField extends TextField { 'id' => $this->id(), 'name' => $this->name, 'value' => $this->Value(), - 'tabindex' => $this->getTabIndexHTML(), + 'tabindex' => $this->getTabIndex(), 'size' => $this->maxLength ? min( $this->maxLength, 30 ) : 30 ); if($this->maxLength) $attributes['maxlength'] = $this->maxLength; diff --git a/forms/CheckboxFieldDisabled.php b/forms/CheckboxFieldDisabled.php index 2ca42a899..2c187202a 100755 --- a/forms/CheckboxFieldDisabled.php +++ b/forms/CheckboxFieldDisabled.php @@ -17,7 +17,7 @@ class CheckboxFieldDisabled extends CheckboxField { 'class' => $this->extraClass() . " text", 'id' => $this->id(), 'name' => $this->Name(), - 'tabindex' => $this->getTabIndexHTML(), + 'tabindex' => $this->getTabIndex(), 'checked' => ($this->value) ? 'checked' : false, 'disabled' => 'disabled' ); diff --git a/forms/ConfirmedFormAction.php b/forms/ConfirmedFormAction.php index 609867a02..d19fb28b9 100755 --- a/forms/ConfirmedFormAction.php +++ b/forms/ConfirmedFormAction.php @@ -19,6 +19,7 @@ class ConfirmedFormAction extends FormAction { $this->confirmation = $confirmation; parent::__construct($action, $title, $form); } + function Field() { $attributes = array( 'type' => 'submit', @@ -26,7 +27,7 @@ class ConfirmedFormAction extends FormAction { 'id' => $this->id(), 'name' => $this->Name(), 'value' => $this->attrTitle(), - 'tabindex' => $this->getTabIndexHTML(), + 'tabindex' => $this->getTabIndex(), 'onclick' => "return confirm('$this->confirmation');" );