[sf-perl] passing checkboxes as hidden fields
Thomas Brightbill
thomas at brightbill.net
Wed Jun 4 14:24:55 PDT 2008
On Wed, 4 Jun 2008, ken uhl wrote:
> The checkboxes are all all the named 'tagbucket'
> with different values,
> so I retrieve those this way
>
> use CGI;
> my $cgi = new CGI;
>
> my @boxes = $cgi->param('tagbucket');
>
> This gives me a nice array of check box field names, but I don't know if
> they are selected,
Isn't the name of all the checkboxes "tagbucket"?
This should give you an array containing all the values of the *checked*
checkboxes (e.g. $cb_name_X, $cb_name_Y, $cb_name_Z, ....)
> Any suggestions ?
check the HTML. are the names and values being properly generated for
the 'tagbucket' checkboxes on your form.
you could also add
use Data::Dumper;
and
print Dumper(@boxes)
to help troubleshoot.
HTH,
Thomas
Thomas Brightbill
thomas at brightbill.net
http://www.brightbill.net
More information about the SanFrancisco-pm
mailing list