yii2-bootstrap5 icon indicating copy to clipboard operation
yii2-bootstrap5 copied to clipboard

no error text when use inputTemplate

Open mgrechanik opened this issue 9 months ago • 0 comments

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

mgrechanik avatar May 08 '24 07:05 mgrechanik