[Forms] Remove a field from a Form

Recently I wanted to remove a field from a form object. It was easy, we need to know 2 things:

  • Fieldset name (‘main’ by default)
  • Field name

With this information we can just update the form object with:

 
 
  1. <?php $this->getForm()->removeField('password_fieldset'); ?>

Leave a Reply

Your email address will not be published.