Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: How to check value of checkbox on form submit?

by cei (Monk)
on May 10, 2000 at 21:54 UTC ( #11018=note: print w/replies, xml ) Need Help??


in reply to How to check value of checkbox on form submit?

All of this is assuming, of course, that you are passing a value to $input. You didn't really specify how you were parsing the form results. One way is the following:
#!/usr/bin/perl -w use CGI; use strict; my $page = CGI::new(); my $input = $page->param('checkbox1'); if ($input eq 'on') { # do something } else { # do something else } exit (0);
with the HTML set like the others have suggested, giving a value of "on" to the checkbox named "checkbox1".

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11018]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2022-08-16 11:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?