Working With Radiobuttonlist

Hi All,

I am new to yii framework. pl help me with radioButtonList option.

I am trying to add radio button with two options below is the snippet:

   <div class="row">

	<?php echo $form->labelEx($model,'iataNo'); ?>


		echo $form->radioButtonList($model,'iataNo',array(1=>'Yes', 0=>'No'),array('separator'=>' '));


	<?php echo $form->error($model,'iataNo'); ?>


It does not render properly. The output is like:






what to fix to get it alligned in single row like

Label ()Yes ()No

Thank in adv for your reverts.

<?php echo CHtml::radioButtonList('gender_code','',array('Male'=>'Male','Female'=>'Female'),array(

    'labelOptions'=>array('style'=>'display:inline'), // add this code


)); ?>


Use single quotes for 1 and 0 in array


echo $form->radioButtonList($model,‘iataNo’,array(‘1’=>‘Yes’, ‘0’=>‘No’),array(‘separator’=>’ '));


Thanks this worked.

…Sir I have one doubt ,that if you use radiobuttonlist as you said,and saved the data selected in database ,and how would show the data from database,which is checked…next time on page load