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")); ?>
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")); ?>