# How to add captcha to form Adding captcha to forms is pretty easy and can be done in three steps: 1. Add new field and validation rule in the model 2. Show captcha in view 3. Add captcha action in controller In this guide I would like to show you how to add captcha field in the registration form but you can add captcha to any form following this steps. > **NOTE:** Captcha will not work with ajax validation enabled ([see](https://github.com/yiisoft/yii2/blob/master/framework/captcha/CaptchaValidator.php#L20)). You should not enable it in active form configuration array. ## 1. Adding field and validation rules to model First of all you need to override Registration form as described in special guide. After this done you have to add public property named **captcha** and validation rules. ```php title = Yii::t('user', 'Sign up'); $this->params['breadcrumbs'][] = $this->title; ?>
= Html::a(Yii::t('user', 'Already registered? Sign in!'), ['/user/security/login']) ?>