Motivation
The
type="" parameter is designed for
HTML input tags. A textarea is related, but not an input tag, hence not part of the current spec. The EDITFORMFIELD can be enhanced to support
type="textarea". This came up in
Support.SID-02240.
Description and Documentation
-
"fieldname" type="textarea" value="..." size="80x6" - multi line text area field, size denotes columns x rows.
Examples
Impact
Implementation
Patch:
--- TWiki/Render.pm (revision 30200)
+++ TWiki/Render.pm (working copy)
@@ -1525,6 +1525,28 @@
my $html = '</form>';
return $html;
+ } elsif( $type =~ /^textarea$/ ) {
+ # special case, construct <textara></textarea> tags
+ my $html = "<textarea name=\"$formField\"";
+ my $needsClass = 1;
+ my $class = 'twikiTextarea';
+ foreach my $key ( keys %$params ) {
+ next if( $key =~ /^(_DEFAULT|_RAW|name|size|type|text|value)$/i );
+ $needsClass = 0 if( $key =~ /^class$/i );
+ $html .= " $key=\"" . $params->{$key} . '"';
+ }
+ my $size = $params->{size} || '';
+ if( $size =~ /^([0-9]+)x([0-9]+)$/ ) {
+ $html .= " cols=\"$1\" rows=\"$2\"";
+ } elsif( $size =~ /^([0-9]+)$/ ) {
+ $html .= " cols=\"$1\" rows=\"6\"";
+ }
+ if( $needsClass ) {
+ $html .= ' class="twikiTextarea"';
+ }
+ $html .= '>' . $value . '</textarea>';
+ return $html;
+
} elsif( $type ) {
# special case, construct an <input type="" /> tag
my $html = "<input name=\"$formField\" type=\"$type\"";
--
Contributors:
Peter Thoeny - 2016-08-14
Discussion
Accepted by
KampalaReleaseMeeting2016x08x18
--
Peter Thoeny - 2016-08-18
This is now in
SVN trunk and 6.0 branch. Docs updated at
TWiki.VarEDITFORMFIELD and
TWiki06x00.VarEDITFORMFIELD.
--
Peter Thoeny - 2016-08-31