Frage

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?

War es hilfreich?

Lösung

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'];
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top