Hello all friends in yii Plz help me!!
I use radio box for field quired when I am select it and then submit it always show this field cannot be blank.
this is my view
<?php
$accountStatus = array(1=>'Prepaid',2=>'Collect');
echo $form->radioButtonList($model,'freight',$accountStatus,array('separator'=>' '));
?>
<?php echo $form->error($model,'freight'); ?>
<?php echo $form->hiddenField($model,'freight');?>
this is my controller
public function actionCreate()
{
$model=new Booking;
// Uncomment the following line if AJAX validation is needed
$this->performAjaxValidation($model);
if(isset($_POST['Booking']))
{
$model->attributes=$_POST['Booking'];
if($model->save())
$this->redirect(array('view','id'=>$model->id));
}
$this->render('create',array(
'model'=>$model,
));
}