in reply to Cannot clear cgi param (if it's really what I need to do)
According to the CGI documentation (under "CREATING FILL-OUT FORMS"), you have to tell it that you really mean for the parameter to be what you asked it to be. (I have found this behavior annoying frequently, but it is documented.)
use CGI; my $cgi = CGI->new(); $cgi->param( 'mode', 'orig' ); print $cgi->hidden( 'mode', 'second arg' ), "\n"; print $cgi->hidden( -name => 'mode', -default => 'default', ), "\n"; print $cgi->hidden( -name => 'mode', -default => 'forced', -override => 1 ), "\n"; __END__ <input type="hidden" name="mode" value="orig" /> <input type="hidden" name="mode" value="orig" /> <input type="hidden" name="mode" value="forced" />
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Cannot clear cgi param (if it's really what I need to do)
by lepetitalbert (Abbot) on Jan 30, 2008 at 18:34 UTC | |
by kyle (Abbot) on Jan 30, 2008 at 19:08 UTC | |
by lepetitalbert (Abbot) on Jan 31, 2008 at 09:33 UTC | |
by ikegami (Patriarch) on Jan 31, 2008 at 10:16 UTC | |
by lepetitalbert (Abbot) on Jan 31, 2008 at 12:26 UTC |