• Hello,

    Thank you for developing this plugin, it is a great help for my website. However, I tried to implement it on a multi-page form, with the hCaptcha on the very first page.

    It does not fail when I change pages, but sadly, it fails at the very end when I click on the “submit” button. I think it is because it tries two times to “verify” the CAPTCHA (with a POST request on https://hcaptcha.com/siteverify).

    Do you know if there is any way to fix this, please?

    Thank you for everything,
    Best regards,

    • This topic was modified 2 years, 4 months ago by hackergen.
    • This topic was modified 2 years, 4 months ago by hackergen.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Kevin Landsbergen

    (@webandappeasy)

    I haven’t seen it verify twice before. It should only verify once as it is a function that gets fired on each form submission.

    Are there 2 forms visible on the page, like maybe one in the footer too?
    If so, what are the settings that you use for the field?

    I have also almost an update ready to go live, so maybe that will fix it for you as I reworked some functionalities. But I still want to try to replicate your issue.

    Please let me know.

    Thread Starter hackergen

    (@hackergen)

    Hello,

    Yes it calls the hook “validation” two times: first time when I fill the Captcha and go to the next page, and second time when I submit the entire form at the last page.

    There aren’t two forms on the same page, nor any other Captcha on the page. I don’t use any specific settings for the field, I leave it as default:
    – Field Label: “CAPTCHA”
    – Description: (nothing)
    – Choose theme: Light
    – Choose size: Standard
    – Custom CSS Class: (nothing)
    – Admin Field Label: (nothing)
    – Overwriting site key: (nothing)
    – Choose mode: Visible
    – reCAPTCHA compatibility: (nothing)

    I checked the code of the “reCAPTCHA” field of Gravity Forms, and indeed it looks like there are two verifications to avoid problems on multi-pages forms. Here is the comments on the 85th line and on the 153~155th lines of the “gravityforms/includes/fields/class-gf-field-captcha.php” file:

    * This method always gets called on the last page of a form, as well as on the page where the field is assigned.
    
    [...]
    
    * In our application flow, we create a decoded string out of the reCAPTCHA service response if the reCAPTCHA field
    * is added to the form on a page other than the last page. We therefore first attempt to validate the decoded response,
    * falling back to validating the reCAPTCHA with a request to Google.

    Thank you for answering me.
    Best regards,

    • This reply was modified 2 years, 4 months ago by hackergen.
    Plugin Author Kevin Landsbergen

    (@webandappeasy)

    Thank you for providing me your field details.

    I think I understand it now correctly.
    You have only one hCaptcha field on a multi-page form, but instead of on the end of the form (last page), you have the field on the first page of the form.

    So the idea is also they only can go to the next page when solving the captcha and submitting can be done without?

    I do have a multistep form created on gravity forms, now I set up hcaptcha but when people go to step 2 don′t allow them to continue, it keeps it loading and loading.
    I deactivated the hcaptcha plugin and the form works usually. What can I do to place hcaptcha on the form and keeps people going on the multistep form properly?

    Plugin Author Kevin Landsbergen

    (@webandappeasy)

    Can you provide me a link to your form or give me a more precise description on how and where you place the hCaptcha field in the multi-step form?
    And what are your form settings, for example using Ajax of not?

    Thank you in advance!

    Thanks for your response. Can I do it in private? Is there any contact way to get to you?

    Plugin Author Kevin Landsbergen

    (@webandappeasy)

    You can send me a message by email on: dev[at]webandappeasy[dot]com

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘hCaptcha always fail on multi-page form submit’ is closed to new replies.