in reply to Problem with data fields duplicating in reentrant CGI form
If there is no parameter named BillName then param('BillName') will return; without a value, which causes the hash to have this structure:$query->textfield( -name => 'BillName', -value => $query->param('BillName'), -maxlength => 70, -size => 50, )
You can confirm with this example code:$query->textfield( -name => 'BillName', -value => -maxlength, 70 => -size, 50 => undef, )
#!/usr/bin/perl use strict; use warnings; use CGI; use Data::Dumper; my $cgi = CGI->new; my %data = ( a => $cgi->param('a'), b => $cgi->param('b'), ); print "Content-type: text/plain\n\n"; print Dumper(\%data);
|
|---|