in reply to Can HTML::FillInForm handle multiple checkboxes?

Your error is, that you call $query->param('typeofinfo') in scalar context. If you want a list ask for a list ;-).
This example check 1 and 4.
use HTML::FillInForm; use HTML::Template; use CGI; my $query = CGI->new; my $html = <<__TEMPLATE__; <input type="checkbox" name="typeofinfo" value="1" /> Program<br /> <input type="checkbox" name="typeofinfo" value="2" /> Abstracts<br /> <input type="checkbox" name="typeofinfo" value="3" /> Exhibits<br /> <input type="checkbox" name="typeofinfo" value="4" /> Registration<br +/> __TEMPLATE__ my $fillinformvalues = { typeofinfo => [ 1, 4 ] }; my $form = new HTML::FillInForm; my $page = $form->fill( scalarref => \$html, fdat => $fillinformvalues ); print $page;
Boris

Replies are listed 'Best First'.
Re^2: Can HTML::FillInForm handle multiple checkboxes?
by ikegami (Patriarch) on Aug 05, 2005 at 15:17 UTC
    The fix is:
    $fillinformvalues = { typeofinfo => [ $query->param('typeofinfo') ] }

      Perfect. What a couple of brackets won't do for ya!

      I knew that the CGI was returning a list, I just didn't know how to get it into my $fillinformvalues hash. Good stuff. Thanks!


      —Brad
      "The important work of moving the world forward does not wait to be done by perfect men." George Eliot
Re^2: Can HTML::FillInForm handle multiple checkboxes?
by tinita (Parson) on Aug 05, 2005 at 15:26 UTC
    Your error is, that you call $query->param('typeofinfo') in scalar context.

    nope, in the original post it's called in list context which is causing the error.
    i think that's what you meant.