Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Dropdownlist

$
0
0
I want to show a selected value from the table in the dropdownlist as the starting value like the "prompt" statement.
When i am displaying using prompt,then on sending the form, the value is not set and its storing blank.If i am selecting another value, then its working fine.
If i am using value instewad of prompt,its not showing selected value.Please help me.

Here $model is my model, $modellist is the list.
<?php echo $form->dropDownList($model, 'id', CHtml::listData($modellist, 'id', 'name'), array('value' =>(isset($model->name))?$model->name:"Select")); ?>

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>