Subject: | Patch for CGI.PM to allow passing a hash for labelattributes |
Date: | Fri, 6 Sep 2013 08:28:56 +1000 |
To: | bug-CGI.pm [...] rt.cpan.org |
From: | John Huijsing <john.huijsing [...] gmail.com> |
Hi
A very simple patch
I wanted the ability to have a different background colors for individual
check-boxes in a group
modify around line 2503
from
if ($XHTML) {
push @elements,
CGI::label($labelattributes,
qq(<input type="$box_type" name="$name" value="$_"
$checkit$other$tab$attribs$disable/>$label)).${break};
} else {
to
if ($XHTML) {
my $labelattr = ref $labelattributes eq 'HASH' ?
$labelattributes->{$_} : $labelattributes ;
push @elements, CGI::label($labelattr,
Thanks for the code :)
John ( a part time perl hacker)