From 70d41d5dc9ee1b0609e3d95434da4c80d79e3e8d Mon Sep 17 00:00:00 2001 From: Romain Louis Date: Wed, 7 Nov 2007 02:03:48 +0000 Subject: [PATCH] Readonly work git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44405 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/TextareaField.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/forms/TextareaField.php b/forms/TextareaField.php index 7510550a3..b8de19d7e 100755 --- a/forms/TextareaField.php +++ b/forms/TextareaField.php @@ -37,7 +37,10 @@ class TextareaField extends FormField { $disabled = $this->disabled ? " disabled=\"disabled\"" : ""; $readonly = $this->readonly ? " readonly=\"readonly\"" : ""; - return ""; + if( $this->readonly ) + return "id() . "\" name=\"{$this->name}\" rows=\"{$this->rows}\" cols=\"{$this->cols}\">" . ( $this->value ? Convert::raw2att( $this->value ) : '(not set)' ) . ""; + else + return ""; } /** @@ -63,5 +66,9 @@ class TextareaField extends FormField { $this->readonly = false; return $this; } + + function Type() { + return parent::Type() . ( $this->readonly ? ' readonly' : '' ); + } } ?>