Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Captcha::reCAPTCHA with CGI::FormBuilder and TT2

by LesleyB (Friar)
on Nov 19, 2008 at 11:10 UTC ( [id://724543]=note: print w/replies, xml ) Need Help??


in reply to Captcha::reCAPTCHA with CGI::FormBuilder and TT2

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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2024-04-19 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found