Author: spadkins
Date: Tue Sep 4 08:46:05 2007
New Revision: 9915
Modified:
p5ee/trunk/App-Widget/lib/App/Widget/TextArea.pm
Log:
Add read only attribute.
Modified: p5ee/trunk/App-Widget/lib/App/Widget/TextArea.pm
==============================================================================
--- p5ee/trunk/App-Widget/lib/App/Widget/TextArea.pm (original)
+++ p5ee/trunk/App-Widget/lib/App/Widget/TextArea.pm Tue Sep 4 08:46:05 2007
@@ -29,6 +29,7 @@
size => 8, # from HTML spec
maxlength => 18, # from HTML spec
tabindex => 1, # from HTML spec
+ readonly => 1, # from HTML spec
style => "mystyle", # from HTML to support CSS
color => "#6666CC", # from CSS spec
font_size => "10px", # from CSS spec
@@ -91,6 +92,9 @@
my $cols = $self->{cols} || 10;
my $wrap_html = "";
my $wrap = $self->{wrap};
+ my $readonly = $self->get("readonly");
+ my $readonly_html = "";
+
if (defined $wrap) {
if ($wrap =~ /^(hard|off|physical|soft|virtual)$/) {
$wrap_html = " wrap=\"$wrap\"";
@@ -99,8 +103,11 @@
$wrap_html = " wrap";
}
}
+
+ $readonly_html = " readonly" if (defined $readonly);
+
my $tabindex = $self->{tabindex};
- $html = "<textarea name=\"${name}\" rows=\"$rows\" cols=\"$cols\"$wrap_html>\n";
+ $html = "<textarea name=\"${name}\" rows=\"$rows\" cols=\"$cols\"$wrap_html $readonly_html>\n";
$html .= $html_value;
$html .= "</textarea>";
$html;
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.