J
J
JohnDaniels2018-05-18 12:31:29
Yii
JohnDaniels, 2018-05-18 12:31:29

Why doesn't compare work?

validation rules in the model:

public function rules()
    {
        return [
            ['password_compare', 'compare', 'compareAttribute'=>'password', 'message'=>"Пароли не совпадают"],
        ];
    }

the form:
<div class="content_add-center-item">
    <div class="content_add-center-item-title">
        Новый пароль:
    </div>
     <div class="content_add-center-item-field">
            <?= $form->field($model, 'password')->textInput() ?>
     </div>
</div>
<div class="content_add-center-item">
     <div class="content_add-center-item-title">
            Повторите новый пароль:
     </div>
     <div class="content_add-center-item-field">
            <?= $form->field($model, 'password_compare')->textInput() ?>
      </div>
</div>

Finally,
5afe9cb7b344a047562431.png
what am I doing wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question