I have following code in my view
<?php echo $form->dropDownList($model,'p_28',
CHtml::listData(AdCourt::model()->findAll(),'id','name') ,
array(
'class'=>'form-control',
'style'=>'width:100%;',
'empty'=>Yii::t('plaint','Суд турини танланг'),
'ajax' => array(
'type'=>'POST', //request type
'url'=>$this->createUrl('getcourts'),
'update'=>'#ABlockForm_p_29',
)
)); ?>
AdCourt
takes values from ad_court
table. This tables consists of id
, name
and court_id
. I need to save database court_id
instead of id
.
How can I do it?