W
wana
I was going crazy over this stupid thing because the second text field
wouldn't display $a. I had to put in -force=>1 for it to work. Is
that normal? I thought I had a bad CGI.pm, but Dr. Stein's examples
ran fine on my system. I scrutinized his simple examples so closely
and couldn't find what I was doing wrong. Of course, the examples I
was looking at didn't involve displaying a result in a textfield.
#!/usr/bin/perl
use CGI ':standard';
$a = "";
if (param)
{
@a = param('horse');
$a = join (',',@a);
$b = param('tuna');
$c = param('cow');
$a = "$a, $b, $c.";
}
print header;
print start_html({-bgcolor=>'pink',-title=>'poop'});
print start_form;
print
radio_group({-name=>'tuna',-value=>['rug','carpet','tile','wood'],-rows=>2}),
checkbox_group({-name=>'horse',-value=>['dog','cat','pig','turkey'],-rows=>2}),
textfield({-name=>'cow'}),
textfield({-name=>'chicken',-value=>$a,-force=>1}),
,submit({-name=>'enter'});
print end_form,end_html;
wouldn't display $a. I had to put in -force=>1 for it to work. Is
that normal? I thought I had a bad CGI.pm, but Dr. Stein's examples
ran fine on my system. I scrutinized his simple examples so closely
and couldn't find what I was doing wrong. Of course, the examples I
was looking at didn't involve displaying a result in a textfield.
#!/usr/bin/perl
use CGI ':standard';
$a = "";
if (param)
{
@a = param('horse');
$a = join (',',@a);
$b = param('tuna');
$c = param('cow');
$a = "$a, $b, $c.";
}
print header;
print start_html({-bgcolor=>'pink',-title=>'poop'});
print start_form;
radio_group({-name=>'tuna',-value=>['rug','carpet','tile','wood'],-rows=>2}),
checkbox_group({-name=>'horse',-value=>['dog','cat','pig','turkey'],-rows=>2}),
textfield({-name=>'cow'}),
textfield({-name=>'chicken',-value=>$a,-force=>1}),
,submit({-name=>'enter'});
print end_form,end_html;