dsteam
(Dst34m)
January 15, 2014, 2:59am
1
i have some problem with drop down list, i defined value of item directly on dropdownlist form without table relation, when i runing this form and try to select 1 item from that drop downlist and i save it, there is nothing fill in the field in db. can give me help?
<?php echo $form->dropDownListRow($model,'EMP_RELIGION',array(
'empty'=>'----- Pilih Agama -----',
'Islam',
'Kristen',
'Katolik',
'Hindu',
'Budha',
));
?>
i have some problem with drop down list, i defined value of item directly on dropdownlist form without table relation, when i runing this form and try to select 1 item from that drop downlist and i save it, there is nothing fill in the field in db. can give me help?
<?php echo $form->dropDownListRow($model,'EMP_RELIGION',array(
'empty'=>'----- Pilih Agama -----',
'Islam',
'Kristen',
'Katolik',
'Hindu',
'Budha',
));
?>
Please post this in the Yii 1.x forum. This is a Yii 2.x forum. If your query is for Yii2, you need to use
$form->field($model, 'EMP_RELIGION')->dropDownList($data, $options);
cent040
(Arfan67)
April 9, 2014, 11:39am
3
if you are using yii2.0 use below code for dropdrown list
$items = array("1" => "first" , "2" => "second");
<?= $form->field($model, 'cat_id')->DropDownList($items , $options = [])