Hi

This is an extension on this theme so I am adding this query here in the hope the thread will bump in some way and someone might be able to offer some advice.

I have this CGI::FormBuider object instantiation

my $form = CGI::FormBuilder->new( template => { ## the templ +ate being used type=> 'TT2', template => 'method1.tt', variable => 'form', engine => { INCLUDE_PATH => './templates', RELATIVE => '1', }, data => { twinkle => 'this is a test', recaptcha => $recaptcha, }, }, id => 'form', fields => \@formfields , ## declares +where the formfields can be found method => 'post', ## the HTML +form method action => $ENV{SCRIPT_NAME}, ## ensure th +e action is set properly sticky => 1, #debug => 2, ## sets the + debug level int[0,3] ? );

Specifically please note the data element in the template hash.

I set my $recaptcha = $crc->get_html(PUBIC_KEY);, $crc being my Captcha::reCAPTCHA object, and have verified that $recaptcha does hold the expected markup.

When I write [% twinkle %] in the template I get the expected result - i.e. the string is printed out.

When I try [% recaptcha %] I get nothing out. If I print $recaptcha; after printing the form headers, I do get the recaptcha showing.

I am trying to glean why from http://search.cpan.org/grep?cpanid=NWIGER&release=CGI-FormBuilder-3.0501&string=data&i=1&n=1&C=0#lib/CGI/FormBuilder/Template/TT2.pm but I wondered if anyone has similar experience with the problem of passing non-form variable data to a form using CGI::FormBuilder and TT2 and let me know if I am on a hiding to nothing here.

Regards and thanks in advance

Lesley

Update: I also added teststr => $test, to the data hash and then added [% teststr %] to the template and achieved no output with this construct either.


In reply to Re: Captcha::reCAPTCHA with CGI::FormBuilder and TT2 by LesleyB
in thread Captcha::reCAPTCHA with CGI::FormBuilder and TT2 by LesleyB

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.