I need to add a placeholder into my dropdown
and somehow it doesn't work.
Here is my input field:
<?= $form->field($category, 'id')->dropDownList($categoryList, [
'id' => 'category-id',
'prompt' => 'Select category', [
'disabled' => true,
]
]); ?>
Could someone explain me what I'm doing wrong? Thanks for any help!
DropDownList
has no placeholder
, use 'prompt'
instead:
$form->field($category, 'id')->dropDownList($categoryList, [
'id' => 'category-id',
'prompt'=>'- Select category -'
]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With