Captcha Validation Error [Solved]

I’m having trouble with a captcha on a registration page. It works properly until I try to add it to a scenario. Then it repeatedly gives me a “verification code is incorrect” error. The captcha on the contact page works perfectly, and I can’t recreate the error there. Any ideas about what could be going wrong?

The validation code is just the usual:




[['first_name', 'last_name', 'email', 'pass', 'passRepeat', 'verifyCode'], 'required', 'on' => 'register'],

.

.

['verifyCode', 'captcha', 'on' => 'register']];



Are you running validate() before you run the actual save()? Once you validate the captcha as good, it resets and save() will fail the validation check. If you’ve already validated, you’re going to want to skip the validation on the save call.

Ah, yes. I suppose I could skip the validation of the captcha through behaviors?

Or, if you’ve already validated, just call save(false) to skip the repeated validation check.

1 Like

Wonderful. Thank you for your help! :)

I was having the same problem, this fix, Thank you