Skip to content
Advertisement

Tag: symfony-forms

Symfony6 – add iput field after submitting form

i have an ChoiceType::class input field in my form with, now just as an example, two choices: ‘choices’ => [‘type1’ => ‘1’, ‘type2’ => ‘2’] now when the user select type2 i want to add an exta TextType::class inputfield to the form. But i dont want to show the input field before and i want it to be required if

Symfony Update data with a post request

I am currently trying to update a Person in a table. The Table looks the following: I want to be able to update the First-and Lastname and also the nin when I click on the Submit button. My twig file looks like this: And my controller is the following: Currently when I click update I just fill it what’s in

Using validation groups on EasyAdmin 3.x

I want to use validation groups with EasyAdmin 3.x when creating a new User to validate every field. I have a User entity with name, phone, and email fields and use @UniqueEntity in a “creation” group, so I can update the User in a form I created outside from EasyAdmin. That works just fine, but I can’t manage to find

Creating a Symfony 4 Form without Database

I’m new to symfony and want to to create a simple contact form, take the submitted values and send them as an Email. I don’t want to save anything in the database. I followed the documentation on this page: https://symfony.com/doc/current/form/without_class.html I created a new page/action with the code from the page above: But this gives me an error: What am

Symfony form collection rendering

I’m using symfony 2.3 I have form with field of type “collection” Visualization code in twig: Everything work, expect when form.fields is empty. Then nothing is visualized in twig loop, witch is fine. But at the end of the form there is “label” for the element “form.fields”. Only label. Workaround: If there are elements, they will be rendered in the

Advertisement