> $query->param(-name=>'foo', -value=>'the value');
Make that line $query->param(-name=>'foo', -value=>"$the_value");
Then somwhere at the start where you get the variables;
my $name = $query->param('name')||'';
if ($name =~/mary/i){ $the_value = "Howdy Mary" }
How you do it depends on your workflow/logic
Owen
Thanks for your response, but I still don't get it. I type my name into
the box and click
Submit, but it doesn't change!
Could you please clarify?
Here's my code:
#!/usr/bin/perl -w
# This script is the example at the top of the CGI pod --richf;
use strict;
use CGI;
my $html = new CGI;
my $new_value;
my $name = $html -> param('name') or '';
if ($name =~ /richf/i) {
$new_value = 'John';
}
print $html -> header,
$html -> start_html('A Simple Example'),
$html -> h1('A Simple Example'),
$html -> start_form,
"What's your name?",
$html -> textfield(-name => 'name'),
$html -> p,
"What's the combination?",
$html -> p,
$html -> checkbox_group(-name=>'words',
-values=>['eenie','meenie','minie','moe'],
-defaults=>['eenie','minie']),
$html -> p,
"What's your favorite color?",
$html -> popup_menu(-name=>'color',
-values=>['red','green','blue','chartreuse']),
$html -> p,
$html -> submit,
$html -> end_form,
$html -> hr;
$html -> param(-name => 'name', -value => $new_value);
print $html -> end_html;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>