in reply to checkbox_group and a link
Well, basically: what CGI.pm calls "labels" in checkbox_group() is text that is directly written next to the checkbox, so not really a <label>. This label is automatically encoded as it seems.
Looks like we'll have to 'reinvent':
# assuming CGI.pm loaded # this function covers only the named parameter style # with '-name' names sub checkbox_group { my %opt = @_; $opt{-values} ||= []; $opt{-labels} ||= { map{($_,$_)} @{$opt{-values}} }; defined $opt{-default} or $opt{default} = ''; $opt{-name} or return; my $i=time; return map { my $id = $opt{-name}.$i++; CGI::checkbox( -name => $opt{-name}, -id => $id, -value => $_, -label => '',#disbale CGI.pm labeling ($opt{-default} eq $_ ? (-checked=>1) : () ) ), qq#<label for="$id">$opt{-labels}{$_}</label># #our "real" lab +eling } @{$opt{-values}}; } print checkbox_group( -name => 'foo', -values => [qw/a b c/], -labels => {a=>'A',b=>'<a href="b">B</a>',c=>'C'}, -default => 'a', );
|
|---|