Register form, V2 checkbox only shows once you click submit button

Created on 7 August 2023, 11 months ago
Updated 8 August 2023, 11 months ago

Problem/Motivation

On a clean install of Drupal 9.5.10 using the Bartik theme, using the V2 Visible Recaptcha (checkbox), on the /user/register page, I have to click on the "Submit" button before the Recaptcha checkbox element shows up.

I'm mostly just curious if that's how it's supposed to work, or if this is some bug or misconfiguration on my part. I'd expect the Recaptcha element to be visible as soon as the form is done loading, but maybe that breaks caching or something?

What I see until clicking "Create new account"

What I see after clicking "Create new account"

I've confirmed this also happens on the /user/password page, just in case this had anything to do with the file-upload field.

πŸ’¬ Support request
Status

Closed: works as designed

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mariacha1

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mariacha1
  • Status changed to Closed: works as designed 11 months ago
  • πŸ‡΅πŸ‡±Poland sandboxpl Poland πŸ‡΅πŸ‡±

    This is indeed how the module works, for both types of recpatcha ( v2 and v3 invisible ) all recaptcha related javascript calls are being triggered only after submitting the form. The main reasons for that are following:
    1) when developing the module, there was a lot of rumors saying that recaptcha might become a paid service, so by doing API calls only when it's really needed we've limited the total amount of calls, this also has good performance impact (imagine having a simple newsletter form added to footer on each page and making recaptcha calls everytime the page is loaded vs making that calls only when user interacts with form )
    2) most of recaptcha logic is delegated to JS libraries, which makes it easier to work with different caching systems

  • πŸ‡ΊπŸ‡ΈUnited States mariacha1

    Aha, thank you for the info!

Production build 0.69.0 2024