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.<br><br><div class="gmail_quote">On Wed, Jun 4, 2008 at 1:43 PM, ken uhl <<a href="mailto:kenuhl@berkeley.edu">kenuhl@berkeley.edu</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
I have a question on how to determine the value of a checkbox ( checked<br>
or unchecked ) when<br>
passing check boxes as hidden fields to a separate cgi.<br>
<br>
The checkboxes are all all the named 'tagbucket'<br>
with different values,<br>
so I retrieve those this way<br>
<br>
use CGI;<br>
my $cgi = new CGI;<br>
<br>
my @boxes = $cgi->param('tagbucket');<br>
<br>
This gives me a nice array of check box field names, but I don't know if<br>
they are selected,<br>
<br>
so I try retrieving each box :<br>
<br>
for my $box ( @boxes ) {<br>
my $box_data = $cgi->param($box);<br>
};<br>
<br>
This give me nothing.<br>
<br>
By the way the check box is defined this way :<br>
<br>
my $cb_name = "bulkdeleteHost-type-$htype-row-$hrowid" ;<br>
my $be_bad = $cgi->checkbox( -name => "tagbucket" , -checked => 0,<br>
-value => "$cb_name" , -label => "Bulk Delete?") ;<br>
<br>
Any suggestions ?<br>
<br>
<br>
_______________________________________________<br>
SanFrancisco-pm mailing list<br>
<a href="mailto:SanFrancisco-pm@pm.org">SanFrancisco-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/sanfrancisco-pm" target="_blank">http://mail.pm.org/mailman/listinfo/sanfrancisco-pm</a><br>
</blockquote></div><br>