dima has asked for the wisdom of the Perl Monks concerning the following question:
<input type="checkbox" name="checkbox" value="on" checked>
When I print the value of checkbox it prints blank instead of on, and thats why pearl code below always goes into else statement. What should I do so that I can check if the checkbox is marked or not?????? Thanks a lot!!!!
if ($field{'checkbox'}) { # checkbox was checked $chkbutton1 = "Yes send me news letter"; } else { # checkbox left unchecked $chkbutton1 = "No don't send me news letter"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How do I check if checkbox in the form was checked or not?
by cLive ;-) (Prior) on Mar 21, 2002 at 18:55 UTC | |
Re: How do I check if checkbox in the form was checked or not?
by Flame (Deacon) on Mar 27, 2002 at 00:42 UTC | |
Re: How do I check if checkbox in the form was checked or not?
by taint (Chaplain) on Jun 13, 2018 at 06:19 UTC | |
Re: How do I check if checkbox in the form was checked or not?
by Juerd (Abbot) on Mar 21, 2002 at 06:22 UTC | |
Re: How do I check if checkbox in the form was checked or not?
by meghavarshney (Novice) on May 23, 2013 at 04:56 UTC | |
Re: Q2: How do I check if checkbox in the form was checked or not?
by Anonymous Monk on Oct 22, 2003 at 17:47 UTC |
Back to
Seekers of Perl Wisdom