I
I
Iossarian2019-03-15 10:29:36
Yii
Iossarian, 2019-03-15 10:29:36

Why is custom error message not displayed in yii2?

use kartik\form\ActiveForm;
<?= $form->field($model, 'type_id')->dropDownList([
                        '0' => 'Выберите тип организации',
                        '1' => 'ИП',
                        '2'  => 'ООО'])->label(false) ?>

[['type_id'], 'number', 'min' => 1, 'message' => 'Выберите тип вашей организации'],

Good afternoon. The problem is that during validation my error message is not displayed, but the default "Value "Organization type" must be at least 1.". What's the matter here?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
I
Iossarian, 2019-03-15
@Iossarian

Issue resolved. Key 0 in the list was replaced by 'promt'.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question