logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: WELCOME to fbusers@xxxxxxxxxxxxxxx: msg#00001

Subject: Re: WELCOME to fbusers@xxxxxxxxxxxxxxx
I found something interesting so I thought I'd share...

When explicitly declaring a textarea, XHTML transitional validation
fails against the output of the formbuilder...

In my cgi, I create a field, like so:
$form->field(name => 'comments', type => 'textarea', cols => 65, rows => 15);

The output that is generated by formbuilder is like so:
<textarea cols="65" id="comments" name="comments" rows="15"
type="textarea"></textarea>

This fails to validate, according to http://validator.w3.org/check ,
because of the "type" attribute above.

So, I added a line to the Field.pm to delete that attribute like so:
> diff -u Field2.pm Field.pm
--- Field2.pm   Sun Feb 19 18:05:48 2006
+++ Field.pm    Sun Feb 19 18:06:35 2006
@@ -754,6 +754,7 @@
         $tag .= '</table>' if $checkbox_table;
     }
     elsif ($type eq 'textarea') {
+       delete $attr{'type'};
         my $text = join "\n", @value;
         delete $attr{value};
         $tag .= htmltag('textarea', %attr) . escapehtml($text) . '</textarea>';


This fixed it to validate for me... YMMV.

HTH,
--Will
<Prev in Thread] Current Thread [Next in Thread>