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


	<?php 


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


	?>


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


</div>

It does not render properly. The output is like:

Lable

()

Yes

()

No

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

    'separator'=>'',

)); ?>



Matt

Use single quotes for 1 and 0 in array

<?php

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

http://www.yiiframework.com/doc/api/1.1/CHtml#radioButtonList-detail

?>

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