T
T
tincap2015-06-05 22:28:20
Yii
tincap, 2015-06-05 22:28:20

How to disable validation errors in Yii2?

It is necessary to disable the output of errors opposite the input fields. I want to display errors using getErrors() only at the top of the form.
724053cf0c234636b6596125f126b1fd.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Khomenko, 2015-06-05
@tincap

Try setting the enableClientValidation parameter to false on yii\widgets\ActiveForm::begin() Added: Set your own field display template. Remove {error} from the line and check again.

$form = ActiveForm::begin([
    'fieldConfig' => [
        'template' => "{label}\n{beginWrapper}\n{input}\n{hint}\n{error}\n{endWrapper}",
    ],
]);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question