I have two tables admissions and the other one is decease.deceaseid is FK for admission and PK for decease.I used drop down list to show the decease list.
with that
<div class="row">
<?php echo $form->labelEx($model,'decease_id'); ?>
<?php echo $form->dropDownList($model,'decease_id',array('first'=>'Please select Decease',CHtml::listData(Decease::model()->findAll(), 'deceaseid', 'decease_name'))); ?>
<?php echo $form->error($model,'decease_id'); ?>
</div>
when admisson form is opened list shows the name of the decease…and user select any of them…but when we saw database of adsmission table…it stored id of the decease rather than its name…and I want to store deceasae name in the database…The deceaseid field in the admission form is of integer type.So what should I do.plz HELP ME OUT.thanks in advance.