From 19d5b377a83750f824fcff068db02f57146cd385 Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Thu, 16 Oct 2008 00:36:50 +0000 Subject: [PATCH] API: add TextField_Disabled git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64323 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/TextField.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/forms/TextField.php b/forms/TextField.php index 618b83305..5429b626c 100755 --- a/forms/TextField.php +++ b/forms/TextField.php @@ -37,4 +37,22 @@ class TextField extends FormField { } + +class TextField_Disabled extends TextField{ + function Field() { + $attributes = $attributes = array( + 'type' => 'text', + 'class' => $this->extraClass() . ' text', + 'id' => $this->id(), + 'name' => $this->Name(), + 'value' => $this->Value(), + 'tabindex' => $this->getTabIndex(), + 'maxlength' => ($this->maxLength) ? $this->maxLength : null, + 'size' => ($this->maxLength) ? min( $this->maxLength, 30 ) : null, + 'disabled' => 'disabled' + ); + + return $this->createTag('input', $attributes); + } +} ?> \ No newline at end of file