You must first sign up to be able to contribute.


It is sometimes useful to group fields in a long form into HTML fieldsets. Some fieldsets may be rendered collapsed and expandable.

After reading forms for web designers, I understand that one of the features of the symfony forms system is strong separation between form development and form design. I suspect that fieldsets are on the design side, so the correct way to add fieldsets to a symfony form is:

<?php echo $form->renderFormTag(url_for(array('module' => 'contact'))) ?>
  <fieldset class="collapsible collapsed">
    <?php echo $form['name']->renderRow() ?>
    <?php echo $form['email']->renderRow() ?>
    <?php echo $form['subject']->renderRow() ?>
    <?php echo $form['message']->renderRow() ?>
  <input class="form-submit" type="submit" />