Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Cannot clear cgi param (if it's really what I need to do)

by lepetitalbert (Monsignor)
on Jan 30, 2008 at 18:34 UTC ( #665183=note: print w/ replies, xml ) Need Help??


in reply to Re: Cannot clear cgi param (if it's really what I need to do)
in thread Cannot clear cgi param (if it's really what I need to do)

Hi kyle,

I came accross the '-override', but as I

print hidden(); instead of print $cgi->hidden()

it has no effect.

Thank you.

Have a nice day

"There is only one good, namely knowledge, and only one evil, namely ignorance." Socrates


Comment on Re^2: Cannot clear cgi param (if it's really what I need to do)
Download Code
Re^3: Cannot clear cgi param (if it's really what I need to do)
by kyle (Abbot) on Jan 30, 2008 at 19:08 UTC

    This does not appear to be the case.

    BEGIN { $ENV{QUERY_STRING} = 'mode=orig'; $ENV{REQUEST_METHOD} = 'GET'; } use CGI qw( hidden ); print hidden( 'mode', 'second arg' ), "\n"; print hidden( -name => 'mode', -default => 'default', ), "\n"; print 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" />

    Perhaps your code is doing something different from what you think it's doing?

      Hi kyle,

      As I print other hidden params

      print hidden( 'day' , $day );

      I printed this one

      print hidden( 'mode' , 'save' , 1 );

      and this don't work.

      print hidden( -name => 'mode' , -default => 'save' , -override => 1);

      works, but I don't understand why ?

      Have a nice day.

      "There is only one good, namely knowledge, and only one evil, namely ignorance." Socrates
        When you don't use the named parameter style, the first argument is the field name and the rest are values for the field.
        print hidden( 'mode' , 'save' , 1 );
        is short for
        print hidden( -name => 'mode' , -default => [ 'save', 1 ]);

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://665183]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2014-09-21 05:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (166 votes), past polls