Compare error passwords = clientValidation #1910

Open
adminnu opened this Issue Jan 1, 2013 · 3 comments

4 participants

@adminnu

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.

@adminnu

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.

@adminnu adminnu added a commit to adminnu/yii that referenced this issue Jan 20, 2013
@adminnu adminnu #1910: Disabled displays error comparevalidator still filled with the…
… second field
96dfd11
@adminnu

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: https://github.com/yiisoft/yii/blob/1.1.13/framework/web/widgets/CActiveForm.php#L479
If the second field does not have any validators $validator [] is empty.
So I added in CModel, here: https://github.com/yiisoft/yii/blob/1.1.13/framework/base/CModel.php#L286
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:
1)

  • 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 Jan 22, 2013
@mdomba
Yii Software LLC member

Isn't this a duplicate of #1528

@adminnu adminnu added a commit to adminnu/yii that referenced this issue Jan 22, 2013
@adminnu adminnu #1910 добавлена ​​взаимная проверка полей в yiiactiveform.js, которая…
… включена для СCompareValidator
5961a8d
@adminnu adminnu added a commit to adminnu/yii that referenced this issue Jan 23, 2013
@adminnu adminnu #1910 crlf new line fix 7a604f1
@cebe cebe modified the milestone: 1.1.16, 1.1.17 Aug 15, 2014
@samdark samdark modified the milestone: 1.1.17, 1.1.18 Dec 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment