質問

Does Anyone know how to use the "required" attribute in Yii booster radioButtonListRow for client side validation only?

echo $form->radioButtonListRow($model, 'radioButtons', array(
        'Option one',
        'Option two',
    ));
役に立ちましたか?

解決

This has nothing to do with yiibooster. Yii deals with it. In your model you can mention rules like which attribute is required

array('your attribute', 'required'),

and you can use this as

echo $form->radioButtonListRow($model, 'your attribute', array(
       '0'=> 'Option one',
        '1'=>'Option two',
    ));

Yii will automatically validate the attribute you have mentioned

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top