in reply to Problem with data fields duplicating in reentrant CGI form
If you want to preserve the user parameters in the HTML you don't need to specify -value => 'fake', as CGI will automatically fetch the value for the field.#!/usr/bin/perl use strict; use warnings; use CGI; use Data::Dumper; my $cgi = CGI->new; print "Content-type: text/plain\n\n"; print $cgi->textfield( -name => 'BillName', -value => 'fake', -override => 1, -maxlength => 70, -size => 50, );
However, if multiple values are sent for the same name, then CGI::param() will return the list of values, which has a similar effect as my previous post.print $cgi->textfield( -name => 'BillName', -value => $cgi->param('BillName'), -maxlength => 70, -size => 50, ); print $cgi->textfield( -name => 'BillName', -maxlength => 70, -size => 50, );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem with data fields duplicating in reentrant CGI form
by Popcorn Dave (Abbot) on Jul 20, 2006 at 15:54 UTC |