문제

Im using Chtml for one of my form in my Yii project.

I have implemented radioButton in that form , i.e

   <?php echo CHtml::radioButtonList('asset', 'asset', $listAsset, array('uncheckValue'=>null));?>

how can I do validation for this?

도움이 되었습니까?

해결책

we don't want use model name in form mean try the following steps

after assign the attribute values you can assign the post values to model attributes

once you specified the validation in MODEL's rules function, you can use the following steps.

example :

$model->attributes = $_POST['model']; //if you use model name in other fields  

$model->asset = $_POST['asset'];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top