Cform, Renderelement But Not Label

Given a CForm instance $form (not using active form), I am currently doing the following to get a radiolist…

$form->renderElement(‘anAttribute’);

This renders the label ‘An Attribute’ and the radiolist. However I think that the radio button labels are self explanetry.

Is there any way I can not render the label for the list? I could hide using CSS but that is not a path I want to go down. I also didn’t like the sound of setting attibute label to ‘’

Can I do this just using my CForm or am I going to have to bite the bullet and convert my form to ActiveForm

Any help here would be appreciated.

Tom

You may need to write label = ‘’ in the form elements.

try something like this:




'elements'=>array(

    'anAttribute'=>array('type'=>'radio', 'label'=>''),

)