0

I use jlorente remainingcharacters widget to show remaining character countdown for Inputfield in _form.php:

  <?= $form->field($model, 'char52', ['showLabels'=>true])->widget(\jlorente\remainingcharacters\RemainingCharacters::classname(), [
        'type' => \jlorente\remainingcharacters\RemainingCharacters::INPUT_TEXTAREA,
        'text' => Yii::t('app', '{n} characters remaining'),
        'label' => [
            'tag' => 'p',
            'id' => 'my-counter',
            'class' => 'counter',
            'invalidClass' => 'error'
        ],
        'options' => [
            'rows' => '1',
            'class' => 'col-md-12',
            'maxlength' => 52,
            'placeholder' => Yii::t('app', 'Write something')
        ]
    ]) ?>

<?= $form->field($model, 'text', ['showLabels'=>true])->widget(\dosamigos\ckeditor\CKEditor::className(), [
            'options' => ['rows' => 1],
            'preset' => 'full'
    ]) ?>

As I rendered form fields the height of textInput is not the same as standard. Is there any solution for this problem. I am also searching for other widgets for remaining charachters as I want to use kartik\form\ActiveForm for rendering on the same text input remaining charachter count and ActiveField Prepend Addon.

lzak
  • 3
  • 2

1 Answers1

0

Try adding "form-control" class to your widget:

'options' => [
        ...
        'class' => 'col-md-12 form-control',
        ...
    ]
Patrick
  • 1,328
  • 10
  • 19