[sf-perl] passing checkboxes as hidden fields

Garth Webb garth.webb at gmail.com
Wed Jun 4 14:16:21 PDT 2008


If a checkbox is unchecked, the browser will send nothing to you.  Only if
the box is checked will you get a name=value pair.

On Wed, Jun 4, 2008 at 1:43 PM, ken uhl <kenuhl at berkeley.edu> wrote:

> Hi,
> I have a question on how to determine the value of a checkbox ( checked
> or unchecked ) when
> passing check boxes as hidden fields to a separate cgi.
>
> 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,
>
> so I try retrieving each box :
>
> for my $box ( @boxes ) {
>    my $box_data = $cgi->param($box);
>    };
>
> This give me nothing.
>
> By the way the check box is defined this way :
>
>  my $cb_name =  "bulkdeleteHost-type-$htype-row-$hrowid" ;
>  my $be_bad =  $cgi->checkbox( -name => "tagbucket"  , -checked => 0,
> -value => "$cb_name"  , -label => "Bulk Delete?") ;
>
> Any suggestions ?
>
>
> _______________________________________________
> SanFrancisco-pm mailing list
> SanFrancisco-pm at pm.org
> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20080604/23346ec2/attachment.html 


More information about the SanFrancisco-pm mailing list