For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > September 2006 > Re: CGI: How do I populate a form field based on the value entered









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: CGI: How do I populate a form field based on the value entered
Owen

2006-09-23, 6:57 pm

On Sat, 23 Sep 2006 14:21:50 -0400
"RICHARD FERNANDEZ" <rfernandez@arrow.com> wrote:


> I'm trying to create an HTML form that will refresh itself based on user
> input. In the POD for CGI it says that you can set the value of a named
> parameter by using something like:
>
> $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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com