in reply to populating a textarea
Problem #2 is that, yes, indeed, CGI is making your data sticky, meaning it will ignore the value you're trying to create for SPCtext because SPCtext already has a value of the empty string. Sometimes this a good thing. In my experience it's a pain in the butt. Fortunately, fixing it is as simple as adding a "force=>1" parameter to your textarea line, like so:
In short, this code is tested and works:print $query->textarea(-name=>'SPCtext', -cols=>50, -rows=>10, -value= +>$testText, -force=>1);
#!/usr/bin/perl -w use CGI; $query = new CGI; print $query->header; print $query->start_html(); print $query->start_multipart_form("POST", "test.pl"); print "Field Name:"; print $query->textfield(-name=>'FieldOne', -size=>25); print "Field Type:"; print $query->textfield(-name=>'FieldTwo', -size=>25); print "Field Length:"; print $query->textfield(-name=>'FieldThree', -size=>25); print "<br>" . $query->submit('Insert Field'); $testText = $query->param('SPCtext') . $query->param('FieldOne') . $qu +ery->param('FieldTwo') . $query->param('FieldThree'); print $query->textarea(-name=>'SPCtext', -cols=>50, -rows=>10, -value= +>$testText, -force=>1); print $query->submit('Save'); print $query->endform(); print $query->end_html();
Gary Blackburn
Trained Killer
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: populating a textarea
by amulcahy (Acolyte) on Nov 09, 2001 at 18:45 UTC |