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.
|
|---|