V
V
Vlad Osadchyi2018-11-22 15:20:02
Yii
Vlad Osadchyi, 2018-11-22 15:20:02

Auto-complete fields on form generation yii2?

there is such an ActiveForm field

<?= $form
            ->field($model, 'part_number')
            ->textInput([
                'maxlength' => true,
                'id' => 'input2',
                'class' => 'form-control',
                'placeholder' => html::encode($model->getAttributeLabel('part_number')),
                'required' => 'required'
            ])
            ->label(false) ?>

how to make this field filled with certain text initially?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Larin, 2018-11-22
@VladOsadchyi

<?= $form
            ->field($model, 'part_number')
            ->textInput([
                'maxlength' => true,
                'id' => 'input2',
                'class' => 'form-control',
                'placeholder' => html::encode($model->getAttributeLabel('part_number')),
                'required' => 'required',
                'value' => 'какой то текст'
            ])
            ->label(false) ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question