changeing the value write to mysql table from GUI will pull downs.

I have an application that pulls data from tables to populate pull down fields. When the application writes the data to the primary table it uses the index to the pull down value and not the actually value. I want the application to write the value from the pull down window and not the index value to the field.

Can someone point me to where yii writes out the values that I can modify?

Not sure how you are building your drop down, it should be something like this:




<?php echo CHtml::activeDropDownList($model, 'my_select_var', CHtml::listData(Myclass::model()->findAll(),'my_value','my_value'), array('prompt'=>'Please Select')); ?>



So really, there is no need to change anything if you populate the pull down how you want.

Thanks for the reply. I will try and incorporate this approch.

What I current have is

<?php echo CHtml::activeLabelEx($model,‘cpeType_id’); ?>

<?php echo CHtml::activeDropDownList($model,‘cpeType_id’,CHtml::listData(CActiveRecord::model(‘CpeType’)->findAll(),‘id’,‘model’)); ?>

</div>

this is pulling 2 values(‘id’,‘model’) from an sql table “CpeType” and populating the pulldown with the values for ‘model’

when I do a submit from the from, the form inserts the value for ‘id’ in the database record and not the value of model. I would prefer that the submit uses the value form the pulldown for the model and not the ‘id’ value.