Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Compare error passwords = clientValidation #1910

adminnu opened this Issue · 3 comments

3 participants


After entering the password climbs error "Passwords do not match", which does not disappear even after entering the correct password confirmation.

That problem has been resolved, you must first change the password, and then do it again right.

Error occurs with clientValidation, ajaxValidation not offer, we would like to process the field using clientValidation.


It is necessary to finalize the validator to check the first field after the change of the second and did not throw an error when the second has not changed.


first field = password
second field = cPassword

If you do not move away from the architecture $.Yiiacitveform I run a query to check the first field after the change of the second.
Generation for each validator one field we have here:
If the second field does not have any validators $validator [] is empty.
So I added in CModel, here:
Automatically add a validator for the second field, which will serve as the launch for the first field validator.
While created a separate validator CMirrorValidator which is active only clientValidateAttribute(...) which is run validation checks for the first field or fields.
Here the question arises:

  • a. Is it normal that there is a new validator class, which aims only start checking other fields, when the current in the client validation. In this case it is just an empty validator validateAttribute(...)
  • b. Can be added to parammetr CCompareMalidator a positive result which we need is issued in the client validation, and the usual validation is skipped.

3) I think the launch of abnormal validator $.fn.yiiactiveform.validate, since this class can be used not only in CActiveForm, but the other way to start the validation of the second field is not present.
4) If you give up points above have to do a check on the change of the second field of the first, and this entails adding blur to the validator that is not correct, as it destroys the architecture on zapus validation may not blur, and another event.

@mdomba mdomba was assigned

Isn't this a duplicate of #1528

@adminnu adminnu referenced this issue from a commit in adminnu/yii
@adminnu adminnu #1910 добавлена ​​взаимная проверка полей в yiiactiveform.js, которая…
… включена для СCompareValidator
@adminnu adminnu referenced this issue from a commit in adminnu/yii
@adminnu adminnu #1910 crlf new line fix 7a604f1
@cebe cebe modified the milestone: 1.1.16, 1.1.17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.