How to captcha only on create?

Hi,

I am very new to Yii2. I have a model with a captcha and worked perfectly when I want to create new data but when I want to update the data, I got the message “The verification code is incorrect”. I don’t want to use captcha for update. How to disable captcha on update data?

TQ

Hello, this is not hard :). Please read the “Scenario” section on the guide link.

In the example there are two scenario login and register, and for the register the email will be validated as user and password fields, but at login the email will not validated, it is missing from the array.

So you have to do this, you have two scenaro two :). The register and the create scenario. I hope this will be enough for you.