Thank you for your reply. Yes, I am familiar with both these cases. But My Question is how can use this tag for the icon in the yii2 form field
Here is my code
<?= $form->field($model, 'first_name',
'labelOptions'=>['class'=>'text-dark-blue text12 required-star']
, 'wrapperOptions'=>['class'=>'col-sm-12 offset-sm-0 p-0 ']
, 'options'=>['class' => '']
And also I am familiar with the searchable dropdown in select2 and I already implemented it. But I am not able to save the data in the seach field for searchable dropdown into DB if that is not present in the DB. Here is my code. Search is possible in this drop-down and also can save data into Db when we select a value from the drop-down list. But failed to save the data that was typed in the search field and did not exist in the DB. Kindly check and Update.
<?=$form->field ( $model, 'state'
, ['options'=>['class'=>'col mb-3']
,'wrapperOptions'=>['class'=>'col-sm-12 offset-sm-0 p-0']
'items' => ArrayHelper::map(State::getState(),'id','state'),
'options' => ['id' => 'state_id_list', 'class' => 'form-control col-md-12 width-100 state-search','prompt' =>'- Select -'],