I
ioneabu
#!/usr/bin/perl
use warnings;
use strict;
use CGI (':standard');
my $items = param('items');
my @defaults = split ' ', $items;
chomp @defaults;
print header(),start_html();
print start_form();
print table({-border=>1},Tr(td(\@defaults)));
print br(), textfield(-name=>'items');
print br(), checkbox_group(-name=>'boxes',
-values=>\@defaults,
-defaults=>\@defaults);
print br(), submit();
print end_form();
This is a CGI program in which you can type a word or a list of words
separated by a space in the textfield and a checkbox group is generated
from those words. They should all be checked because of the default
setting. Why are they not being checked by default?
Thanks!
wana
use warnings;
use strict;
use CGI (':standard');
my $items = param('items');
my @defaults = split ' ', $items;
chomp @defaults;
print header(),start_html();
print start_form();
print table({-border=>1},Tr(td(\@defaults)));
print br(), textfield(-name=>'items');
print br(), checkbox_group(-name=>'boxes',
-values=>\@defaults,
-defaults=>\@defaults);
print br(), submit();
print end_form();
This is a CGI program in which you can type a word or a list of words
separated by a space in the textfield and a checkbox group is generated
from those words. They should all be checked because of the default
setting. Why are they not being checked by default?
Thanks!
wana