rlb3 has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I’ve been experimenting with CGI::Prototype::Hidden and I’m having a few troubles. And frankly, this might be more of a CGI.pm problem but I’m not sure. I’ve been reading the docs and the code and I know I need to set a hidden _state param. In the docs the example is:
[% self.CGI.hidden(self.config_state_param) %]
This generates something like this:
<input type=”hidden” name=”_state” value=”Search”>
Btw, I overrode the default page to “Search”.
My problem is that I want the value to be “Display” so when I hit the submit button the app will move to the next page. So I tried this:
[% self.CGI.hidden(self.config_state_param,”Display”) %]
This gives a value of “Search” just like the first. If I hard code the hidden field it works as expected. What am I missing here?
My second problem is with self.CGI.end_form. When I tried:
[% self.CGI.end_form %]
I get an ARRAY reference and not the text. I looked at the code in CGI.pm and it looks like that the end_form function returns an array or a scalar depending on context. How do I force scalar context in the Template Toolkit?
Thanks to anyone who can help.
rlb3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Trying to understand how CGI::Prototype::Hidden, Template Toolkit and CGI.pm work together.
by merlyn (Sage) on Mar 09, 2005 at 20:11 UTC | |
by rlb3 (Deacon) on Mar 09, 2005 at 20:18 UTC | |
by jeffa (Bishop) on Mar 09, 2005 at 20:34 UTC | |
by rlb3 (Deacon) on Mar 09, 2005 at 20:42 UTC | |
by DotanDimet (Initiate) on Jul 13, 2005 at 16:38 UTC |