logudotcom
(Logudotcom)
1
I have this code to display dynamic drop down list with condition, like
echo $form->dropDownList($memberVariousCommunityModel,'monthFrom[]',$model->getMonths(), array('options' => array(''.$memberVariousCommunity->monthFrom.''=>array('selected'=>true))));
I am unable to add this css style due to this my form looks like attached.
array('class'=>'span12')
…
I tried this but it does not work,
echo $form->dropDownList($memberVariousCommunityModel,'monthFrom[]',$model->getMonths(),
array('class'=>'span12'), array('options' => array(''.$memberVariousCommunity->monthFrom.''=>array('selected'=>true))));
selvakumar
(Selvakumar Kaliyappan)
2
Hi,
echo $form->dropDownList($memberVariousCommunityModel,'monthFrom[]',$model->getMonths(),
array('htmlOptions'=>array('class'=>'span12'), array('options' => array(''.$memberVariousCommunity->monthFrom.''=>array('selected'=>true)))));
You can just try this one. i think this will help you…
logudotcom
(Logudotcom)
3
Hi,
I am getting this error,
htmlspecialchars() expects parameter 1 to be string, array given
logudotcom
(Logudotcom)
4
timebeing, i fixed this way, it is ok but let me know if there is any proper way …
<style type="text/css">
select#MemberVariousCommunity_monthFrom{width:100%}
</style>
logudotcom
(Logudotcom)
5
Finally this worked out ,
echo $form->dropDownList($memberVariousCommunityModel,'houseId[]',CHtml::listData( House::model()->findAll(array('order'=>'name ASC')), 'id', 'name' ),array('options' => array($memberVariousCommunity->houseId=>array('selected'=>true)),"class"=>"span12"));