Hi,
thanks for your work on this plugin! I update my recaptcha.php code with your last edit and solve some issues. Now i'm trying to do something ... unusual.
I'm trying to include the recaptcha in my own plugin that simply have a form, write on db data, send data via post ajax with return json error, and send mail.
I used the method above on my html page and so add a dvi before the send button:
<?php
JPluginHelper::importPlugin('captcha');
$dispatcher = JEventDispatcher::getInstance();
$dispatcher->trigger('onInit','dynamic_recaptcha_1');
?>
from here :http://stackoverflow.com/questions/12840015/how-to-use-joomla-recaptcha-plugin-to-my-custom-module, and i can view it!
But now two things are strange:
The captcha won't load when i simply refresh the page but only when i refresh with erase browser cache,
The onInit initialise the plugin only one time per session?
But most important how can i verify capctha on submit?
I tried it, on my php send file but the page return me a ajax error.
//Verify captcha
$post = JFactory::getApplication()->input->post;
JPluginHelper::importPlugin('captcha');
$dispatcher = JEventDispatcher::getInstance();
$res = $dispatcher->trigger('onCheckAnswer',$post['recaptcha_response_field']);
if($res) === TRUE) {
$jsonObj = sprintf($status, 1, "ok");
}
else
{
$jsonObj = sprintf($status, 0, "Insert captcha");
}
Have you some suggestions, please?
Thanks
Gabriele
Labels |
Added:
?
|
Category | ⇒ | Plugins |
I think it's a bug in file /plugins/captcha/recaptcha/recaptcha.php in line 80.
Instead of
. '}'
should be:
. '};'
Lack of semicolon causes an javascript error when after code generated by the captcha plugin exists some other code.
Thanks Gbula!
I tried it but without fortune.
I don't know but seems there be. maybe in my case, a conflict with mootols or jquery.
Is there a way to force always initliase a plugin in the same session?
[code]$dispatcher = JEventDispatcher::getInstance(); $dispatcher->trigger('onInit','dynamic_recaptcha_1'); ?>[/code]
I don't know how to debug it...
In console message there are no errors.
I'm feeling thus close to solution but thus far from handle it :)
I'll do more tries.
Thanks
Gabriele
I am in the same boat. reCaptcha simply won't load on a refresh.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-02-18 08:54:39 |
Closed_By | ⇒ | brianteeman |
As the recaptcha has been refactored a lot and considerable changes have been made since this was submitted I am assuming that it has already been fixed elsewhere and am closing this. If you still have the problem please update the issue with the correct line number in the current version of Joomla and it can be reopened
I found solution to verification here:
http://stackoverflow.com/questions/28065375/how-to-add-recaptcha-to-contact-form
Watch peter response!
I only have to understand why recaptcha won't load each time i refresh the page.
Suggestions?
Thanks
Gabriele