Yii2: Error message not showing with tabular input, css class 'has-error' is missing

Created on 29 Mar 2018  路  1Comment  路  Source: yiisoft/yii2

What steps will reproduce the problem?

In the controller, I'm using loadMultiple and validateMultiple to validate several models of the same class.

In the view where I render the form, I have this (as explained in the doc):

<?php foreach ($addresses as $index => $address) { ?>
    <?=
    $form->field($address, "[$index]emailAddress")
    ->textInput(['placeholder' => Yii::t('label', "Enter email address")])
    ->label(false);
    ?>
<?php } ?>

What is the expected result?

If one of the models doesn't validate (server-side), an error message should be displayed.

What do you get instead?

The error message is not showing, because the class "has-error" is missing.
If I name the attribute "emailAddress" instead of "[$index]emailAddress", it works as expected.

Additional info

| Yii version | 2.0.14.1
| PHP version | 5.6.19
| Operating system | Windows 10

bug

Most helpful comment

Duplicated #15801 and solved with 2.0.14.2 hotfix release

>All comments

Duplicated #15801 and solved with 2.0.14.2 hotfix release

Was this page helpful?
0 / 5 - 0 ratings