Skip to content

Friendly Captcha V2 multiple forms problem #2803

@fabiopiro

Description

@fabiopiro

Describe the bug

With multiple forms with Friendly Captcha V2 on the same page, only the first form's captcha works correctly. Subsequent forms show console errors and captcha widgets fail to connect

in web/assets/frontend/src/js/captchas/friendly-captcha-v2.js
It seems that event listeners (lines 69-71) use .bind(this) but aren't stored, so removeEventListener (lines 54-56) can't match and remove them

Steps to reproduce

  1. Add 2+ forms with Friendly Captcha v2 to one page
  2. See friendly captcha widgets

Form settings

  • Submission Method: both

Craft CMS version

5.9.18

Plugin version

3.1.21

Multi-site?

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions