I would like to display the same form several times in order to handle the same action for two different tabs. The problem is that when I try, only the form of the first tab is displayed, an event if I change the identifier and name of the form. I discovered this expected symfony behavior, but I still need it to work.
I found that it can work with the collection, but I donβt understand how it will work.
twig:
{{ form(contactForm, {'attr': {'id': 'contactFormId' ~ Client.Id}, 'name': "contactFormName" ~ Client.Id})}}
the form:
$this->contactForm = $this->createFormBuilder($contact, array('allow_extra_fields' =>true)) ->add('Nom', TextType::class, array('mapped'=>false)) ->add('Prenom', TextType::class, array('mapped'=>false)) ->add('Telephone', TextType::class, array( 'label' => 'TΓ©lΓ©phone')) ->add('Email', TextType::class) ->add('Ajouter', SubmitType::class) ->getForm();
source share