in reply to Re: is there anything more VEXING than checking the $cgi->checkbox ?
in thread is there anything more VEXING than checking the $cgi->checkbox ?

We're on CGI 4.51 perhaps an update is required. This is an odd presumption: I don't know what you're doing wrong. Perhaps it's more accurate to suggest I don't know what the CGI checkbox sub author was smoking that day!

CGI.pm sub checkbox states "$checked -> (optional) turned on by default if true

Suggested that any value other than 0, '', or undef, should "turn on" checked. What "turned on" means is unspecified. It should result in the word "checked" in the HTML . Im passing "on" and it's not there.

I edited the perl lib module CGI.pm .

First I added die $checked; and it said "on". So far so good.

Then I removed that, and at the end where it "returned", I changed that to die. And I get:

<label><input type="checkbox" name="dev" value="on" class="readonly" / +></label>

proving my checked is set to "on",and its missing in the result.

Replies are listed 'Best First'.
Re^3: is there anything more VEXING than checking the $cgi->checkbox ?
by pryrt (Abbot) on Nov 20, 2023 at 15:30 UTC