Radio Button Selected

Hi all

Hi I have Gender(Male/Female) radio button.How can i implement this. By default Male radio button will be selected.whole the things will be inline.

You need to define radioButtonList in your model:




public $gender;



View:




<?php echo $form->radioButtonList($model,'gender'); ?>



Controller (for example):




$model->gender=1;



Hope that helps.

@r4nd4ll

Thanks …For response

But I want inline radio button.Radio Button will be contain two fields(Male and female).By default male will be selected

Model:




	public function getGenderOptions() {

		return array(

			1=>'Male',

			2=>'Female',

		);

	}



View:




<?php echo $form->radioButtonList($model,'gender', $model->getGenderOptions()); ?>