Question

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',
    ));
Était-ce utile?

La solution

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top