misterperl has asked for the wisdom of the Perl Monks concerning the following question:
to check a box, others say-checked => "on"
and still others mandate-checked => 1
What I really find though with Perl CGI is-checked => "checked"
checks the box. Even if anything=undef ??! What you'd EXPECT is that -checked => 0, or "off", or "", or undef, or SOMETHING would toggle it off. No other HTML control field I know if is this ambigious or vexing. The only way I can find to toggle checked-by-default is to have two seperate statements with logic , one WITH -checked and one without, which is more 2X the syntax I want to use. Anyhow- perhaps a complete definitive explaination of defaulting checkboxes here will eventually get googled and help some other unfortunate JAPH who spent way too long on this seemingly trivial issue.-checked => anything
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What's the REAL DEAL with Perl $cgi->checkbox()
by MidLifeXis (Monsignor) on Feb 03, 2015 at 19:01 UTC | |
|
Re: What's the REAL DEAL with Perl $cgi->checkbox()
by kennethk (Abbot) on Feb 03, 2015 at 19:16 UTC | |
by Your Mother (Archbishop) on Feb 03, 2015 at 19:54 UTC | |
by kennethk (Abbot) on Feb 03, 2015 at 21:22 UTC | |
by misterperl (Friar) on Oct 16, 2015 at 21:01 UTC |