Recaptacha validation doesn’t work if the same form is used more than 1 on page
-
Hello Ninja Forms team!
I was surprised to discover that when there are two or more identical Ninja Forms (with the same ID) on a page, reCAPTCHA v3 only works correctly for the first form.
After conducting a brief investigation, I identified the issue inside the includes/Actions/Recaptcha.php file, on line 340. The get_field_id_hash method works correctly only with numerical IDs. However, when there are two forms on the same page, the second form is assigned an ID like “formId_1.” Due to the presence of “_1,” the get_field_id_hash method returns an incorrect value, causing validation to break and resulting in the error message: “Recaptcha validation failed. Please try again later“
- The topic ‘Recaptacha validation doesn’t work if the same form is used more than 1 on page’ is closed to new replies.