Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 89353
Status: rejected
Priority: 0/
Queue: CGI

Owner: Nobody in particular
Requestors: joerg [...]

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

Subject: Using -attributes and -disabled with a checkbox_group generates invalid HTML
Date: Tue, 08 Oct 2013 20:53:24 +0000
To: [...]
From: Jörg Westheide <joerg [...]>
I found the following code to generate invalid HTML: #!/usr/bin/perl -w use strict; use CGI; my $q = CGI->new(); print $q->checkbox_group(-name => 'box', -values => 'a', -disabled => ["a"], -attributes => {"a" => {"foo" => "bar"}}); The generated output is: <label><input type="checkbox" name="box" value="a" foo="bar"disabled='1'/><span style="color:gray">a</span></label> Note the missing white space between foo="bar" and disabled='1'. The bug is reproducible with versions 3.42 and 3.63, presumably all versions in between and possibly older ones, too. Here's a diff of a possible fix of v3.63: --- 2012-11-15 00:42:54.000000000 +0100 +++ 2013-10-08 17:31:02.000000000 +0200 @@ -2476,7 +2476,7 @@ for (@values) { my $disable=""; if ($disabled{$_}) { - $disable="disabled='1'"; + $disable=" disabled='1'"; } my $checkit = $self->_checked($box_type eq 'radio' ? ($checked{$_} && !$radio_checked++) Jörg
Download (untitled) / with headers
text/plain 241b
This issue has been copied to: please take all future correspondence there. This ticket will remain open but please do not reply here. This ticket will be closed when the github issue is dealt with.
Download (untitled) / with headers
text/plain 198b
Rejecting. I'm not accepting any feature requests, patches, or updates to the HTML generating functions of unless they are of a critical nature (i.e. fixing fundamentally broken HTML output).

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to