i am using sonata admin, i like to show/hide my form using radio buttons and javascript my code :
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->with("Group 1")
->add('A', 'choice', array('choices'=>array('g2'=>'g2','g3'=>'g3' )))
->add('B')
->end()
->with("Group 2")
->add('C')
->add('D')
->end();
->with("Group 3")
->add('E')
->add('F')
->end();
}
i like when the user select g2 the group2 display and the group3 hide and when g3 is selected group2 hide and group3 show