C5-8.2.1: Always get an error
Permalink Browser Info Environment
Hi,
I'm trying to incorporate your library in my form. I've looked at the core's form block and and exactly the same, copied this into view.php:
and this into the controller.php:
but it always gives me an error saying the code is entered incorrectly (that's the error string $this->error_code). But the core's form works fine. What can be wrong?
Thank you.
I'm trying to incorporate your library in my form. I've looked at the core's form block and and exactly the same, copied this into view.php:
$captcha = $app->make('captcha'); if($recaptcha) { ?> <div class="form-group"> <?php $captcha->display(); $captcha->showInput(); ?> </div> <?php }
and this into the controller.php:
$captcha = $this->app->make('captcha'); if ($this->recaptcha) { if (!$captcha->check()) { array_push($this->form_errors, $this->error_code); } }
but it always gives me an error saying the code is entered incorrectly (that's the error string $this->error_code). But the core's form works fine. What can be wrong?
Thank you.
Type: | Pre-Sale |
---|---|
Status: | In Progress |

Forgot to mention one thing. My form is submitted through AJAX. What does the captcha actually post if anything? Maybe that's the problem. The core's Securimage captcha posts a code. What should I pass to the controller?
It checks for the g-captcha-response param which should be the g-recaptcha-response id's value.
https://github.com/ExchangeCore/Concrete5-reCAPTCHA/blob/master/src/...
https://github.com/ExchangeCore/Concrete5-reCAPTCHA/blob/master/src/...
I'm facing another issue. A single form works fine. But if I have 2 or more forms on a page, only the first form passes the test, all other forms fail. Does this library work with multiple forms on a page?
Thank you.
Thank you.