L
L
Leopandro2016-07-06 16:52:53
JavaScript
Leopandro, 2016-07-06 16:52:53

How to remove or add an error in the form yourself?

I need to remove an error in validation, for example, I need at least one of the three fields to be filled. Is there any yii validation api. Or do it with ajax?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2016-07-07
@ApXaHgheJI

addError()	        Adds a new error to the specified attribute.	CModel

if($model->validate()) {
} else {
$model->addError('field','добавил кастом ошибку');
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question