I am using an yii dropDownList for creating a drop-down in my form. I want one value for example '78'=>'selected' gets default selected in drop-down .My drop down is
dropDownList($testcontroller,'testid',CHtml::listData(Phases::model()->findAllByAttributes(array('pid'=>$pid)), 'id', 'phaseName'));
Can any one help me in doing this
Thanks 😉
if its coming from database, use something like below (in case of list box or multiple allowed
dropDownListusemultiple=>true)More details about dropDownList : dropDownList() method