FWIW, using the following:

[% USE CGI %]

[% CGI.start_form %]
[% CGI.popup_menu( Name   => 'show_words',
                   Values => [ 'Yes', 'No' ] ) %]
[% CGI.submit %]
[% CGI.end_form %]


I get:

<form method="post" action="" enctype="multipart/form-data">

<select name="show_words" >
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
<input type="submit" name=".submit" />
</form>


No need to force scalar context or a join.  This is with TT v. 2.15 and TT::P::CGI v. 2.67.


Mike



On 9/27/06, Nic Gibson <[EMAIL PROTECTED] > wrote:

On Sep 27, 2006, at 10:18, Jeremiah Foster wrote:

> Hello all,
>
> First post to this list, but I have been lurking for a while.
>
> I am using the CGI plugin to TT and am getting an array reference
> when I
> should be getting an HTML element.
>
> Here is what I have written:
>
>     [% CGI.start_form %]
>     [% CGI.popup_menu( Name   => 'show_words',
>                        Values => [ 'Yes', 'No' ] ) %]
>     [% CGI.submit %]
>     [% CGI.end_form %]
>
> And here is what I get:
>
>     <form method="post" action="">> enctype="multipart/form-data">
>
>     <select name="show_words" tabindex="1">
> <option value="Yes">Yes</option>
> <option value="No">No</option>
> </select>
>     <input type="submit" tabindex="2" name=".submit" />
>     ARRAY(0x86eb4a0)
>
>
> I am getting that last line; "ARRAY(0x86eb4a0)" instead of the
> expected </form> tag.
> Am I doing something wrong here?
>
> Thanks,
>
>       Jeremiah

Hi Jeremiah

iirc, TT always calls methods in list context. end_form looks like it
returns multiple
values in list context.

It's untested but you might try:

        [% CGI.end_form.join('') %]

cheers

nic


_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to