-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple forms with captcha #25
Comments
Thanks for reporting this issue and fixing it! |
Not sure this is correct, Kamil. If what @formatz said is true, it's true for every form field, not only for the captcha field! So what your solution does is this: // now works
$_SESSION['FORM_DATA']['captcha_myFormId'] = 'foobar'; // captcha form 1
$_SESSION['FORM_DATA']['captcha_myOtherFormId'] = 'barfoo'; // captcha form 2
// still doesn't work
$_SESSION['FORM_DATA']['myFormField'] = 'foobar'; // my form field of form 1
$_SESSION['FORM_DATA']['myFormField'] = 'foobar'; // my form field of form 2 Correct would be this $_SESSION['FORM_DATA']['myFormId']['captcha'] = 'foobar'; // captcha form 1
$_SESSION['FORM_DATA']['myOtherFormId']['captcha'] = 'barfoo'; // captcha form 2
$_SESSION['FORM_DATA']['myFormId']['myFormField'] = 'foobar'; // my form field of form 1
$_SESSION['FORM_DATA']['myOtherFormId']['myFormField'] = 'foobar'; // my form field of form 2 |
I think the problem was with multiple captchas, as they were not validated correctly? @formatz, can you precise what was the problem? |
Yes @qzminski , the problem was the validation. |
But that's what I was saying. That's the case for all form fields that have the same name. So if you have two forms with the form field name |
Perhaps I don't understand your problem. |
Hi,
If you add multiple forms to a page and each of them contains a captcha field, only the last field is saved to session data (it overrides the actual value).
I fixed this by adding the formId value to the name of the captcha field :
Thanks,
Fabien
The text was updated successfully, but these errors were encountered: