in reply to Re: How to implement a checkbox that will send data to db
in thread How to implement a checkbox that will send data to db
I don't agree with your advice. Checkboxes are designed to handle boolean values and a checkbox is perfectly suited for this situation, think of common "do you accept these terms" checkboxes. Handling a checkbox with CGI is as easy as the following...
my $boolean = $cgi->param('boolean') || 0; # or better: my $boolean = $cgi->param('boolean') ? 1 : 0; # etc
Afterall, even if a true/false pair of radio buttons were used, user input cannot be trusted and the parameter would have to go through the same / similar process to above.
|
|---|