in reply to Problem with data fields duplicating in reentrant CGI form

I tested the override flag and it worked for me.
#!/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, );
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.
When only one value is submitted these are synonymous:
print $cgi->textfield( -name => 'BillName', -value => $cgi->param('BillName'), -maxlength => 70, -size => 50, ); print $cgi->textfield( -name => 'BillName', -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.

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
    The override flag works for me as well, as I'm using it elsewhere to change the value of hidden fields. But it isn't working to replace what the paramter was prior.

    Revolution. Today, 3 O'Clock. Meet behind the monkey bars.