Hugh Esco | 18 Feb 21:53
Picon

issues with stickiness of loaded data

Hello folks. I'm building a class which uses CGI::FormBuilder for rendering its forms. I have code which
parses a text file. I need to present the form preloaded with the content parsed from the text file, ready
for further maniuplation.

$defref = {
      email_subject => "PrsRls: Testing Software",
      distribute_by => [],
      release_date => $releasedate,
      contact => $contact,
      title => $title,
      subtitle => $subtitle,
      body => $body,
      more_info => $moreinfo,
    };

    print STDERR "About to render page with test release loaded:\n",
        $title,$subtitle,"\n";
    print $form->render(header => 1, sticky => 1, values => $defref );
    print STDERR "Should have just rendered form.\n",
                $releasedate,"\n",$title,"\n",
                "\$defref is $defref.\n";
    print STDERR "In fact, \$defref says the title is: \n$defref->{tit
+le}";

following as best as I can the advice at: http://www.formbuilder.org/contrib/author.pl

In the logs I get:

Now running DistroPrsRls::setup() method.
Just ran setup() method.
(Continue reading)

Will Kallander | 20 Feb 01:19

Re: WELCOME to fbusers <at> formbuilder.org

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.

(Continue reading)

Nate Wiger | 21 Feb 18:53
Picon
Gravatar

Re: WELCOME to fbusers <at> formbuilder.org

Thanks Will, I'll make sure this gets into 3.03.

-Nate

On 2/19/06, Will Kallander <wkallander <at> quietwisdom.com> wrote:
> 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...

Nate Wiger | 21 Feb 21:28
Picon
Gravatar

CGI::FormBuilder 3.03 beta2 release

All-

I finally had time to spin FormBuilder 3.03 beta2 today. I believe
this is CPAN-worthy. It's got alot of new features, including:

   - Subclassable field objects
   - Multilingual messages in utf8 for English, French,
     Spanish, Danish, Norwegian, and Japanese (thanks to all!)
   - Data::FormValidator support (thanks Peter!)
   - optgroup support (finally)
   - XHTML validation bugfixes
   - Internals fixes

It's available from formbuilder.org:

    http://www.formbuilder.org/download/CGI-FormBuilder-3.03_beta2.tar.gz

Please try it out and let me know how it works. I really want to get
this up there - it's been too long.

Thanks,
Nate

P.S. I have plans to put this into Subversion soon so development can
be shared better between everyone...


Gmane