yii2-bootstrap5
yii2-bootstrap5 copied to clipboard
no error text when use inputTemplate
What steps will reproduce the problem?
First working code:
<?= $form->field($model, 'sigmapercent', [
'template' => "{label}\n{input}\n{hint}\n{error}"
])->textInput() ?></div>
works like usual in Yii2.
And now I try to add suffix to the field
<?= $form->field($model, 'sigmapercent', [
'inputTemplate' => '<div class="input-group">{input}
<span class="input-group-text">%</span>
</div>',
'template' => "{label}\n{input}\n{hint}\n{error}"
])->textInput()
What is the expected result?
I see a suffix all right
What do you get instead?
But when I put incorrect value in the field, I do not see error message under the field. Only field's border becomes red. (without reloading the page, only js validation)
Additional info
Q | A |
---|---|
Yii vesion | 2 |
PHP version | 8 |
Operating system | ubuntu |